aboutsummaryrefslogtreecommitdiffstats
path: root/templates/projects/NewAndroidApplication
Commit message (Collapse)AuthorAgeFilesLines
* Update template location for SDK buildJosiah Gaskin2013-07-3114-225/+0
| | | | | | | | This change removes templates from the SDK source tree (from sdk/templates) and points the build/tools.atree build location file to their new location in tools/base/templates Change-Id: Id37b24eceaae6dcc0b3bf5078a759a337cb13467
* Increments revisions on templates used by Android StudioScott Barta2013-07-091-1/+1
| | | | | | | | When we bundle templates with Android Studio 0.2.0, this will let it pick up copies from the bundled folder instead of the older versions with the SDK. Change-Id: I503d062dd4dc2ccfadac4af5901f8a779fe8e7ec
* Fixes to Gradle plugin, support library versionsScott Barta2013-07-023-3/+13
| | | | | | | | | | Small fixes to pass the Gradle Android plugin as a dependency. Changes the v4 support library depencency to pull in a Maven artifact instead of a library jar reference. Adds a small fix to ensure the Java package parameter in new projects is nonempty. Change-Id: Icb3e3a704166c8d03a7996872be6a5082d37e1bb
* Escaping for pathnames in template XML filesScott Barta2013-07-011-10/+10
| | | | | | | | Does proper XML escaping in Freemarker XML templates to avoid problems with pathnames that contain XML-sensitive characters. Change-Id: I1f191ccabd0c81af821c7bbdf88bbb23ba42ff9c
* Use "mavenCentral()" in build.gradle instead of URLSiva Velusamy2013-05-132-1/+5
| | | | Change-Id: Ibb3391a7b1de26baa2492280f542520b2202569e
* Update Gradle templates for Gradle 1.6 and plugin 0.4Xavier Ducrohet2013-05-101-1/+1
| | | | Change-Id: I259f57f074e18be334fc8d9cdb19724e19dcc9df
* Allows build tools version to be passed in.Scott Barta2013-05-062-2/+3
| | | | Change-Id: I64c12c7f2a0887b080752469e6d34320425ad1e1
* Fixes Maven URLs in build.gradle files in templatesScott Barta2013-05-031-2/+1
| | | | Change-Id: I84bd0213a9dcd6cd13ab94c30a18437a8f84d53a
* Modified templates for Gradle projectsScott Barta2013-04-264-8/+51
| | | | | | | | | | | | | | | | | | | | | | | | Modifies the existing templates to output Gradle build files with a new multi-level directory structure. The templates continue to work the old way that Eclipse expects, and the new behavior is only enabled if the "isGradle" global is set to "true". Files to configure the Gradle wrapper are placed in the SDK at tools/templates/gradle/wrapper. This CL changes all file copies and merges to go to fully-qualified directories set up via global variables. Things go to the old locations for non-Gradle builds based on how the globals are set up, but Gradle builds can override output directory variables to reflect the new directory structure. This CL also adds NewAndroidLibrary and NewJavaLibrary project templates, which will be used in the future. The current NewAndroidApplication template also can output a library, which is redundant and confusing; this will likely be fixed somehow in the future. Change-Id: Ieb830bdfba1797d87a218326ebd37c99d254758e
* Update application template display names and descriptions.Roman Nurik2012-12-131-1/+1
| | | | Change-Id: Id785c8527eb1602b2b6f29e09fb13f628abaf652
* 41154: Handle allowBackup properly for target < 4Tor Norbye2012-12-101-2/+2
| | | | | | | | This fixes 41154: Template Android Application Project for API v3 reports AAPT problem with android:allowBackup="true" Change-Id: I74b4cd0f8df9a74fe9221250cc83b1d15821ce51
* Lint fixes for FullscreenActivity and NewAndroidApplication templates.Roman Nurik2012-10-251-1/+2
| | | | | | | - Remove extraneous string in FullscreenActivity - Add allowBackup=true to NewAndroidApplication Change-Id: I12706cff2ab7b73f04634f47fea4eb14b0ed4e2a
* 37497: Templates should escape string literals in resource filesTor Norbye2012-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the user enters an activity title like "Android's Tools" in the new template wizard, an invalid strings.xml file is generated, since the apostrophe is not properly escaped. To fix this, there's a new string conversion method in the template engine, "escapeXmlString", which will perform all the necessary conversions. It also adds two other XML escaping functions: one to escape text to be suitable for XML attribute values, and one to be suitable for XML text values. Finally, when verifying this, I discovered that if I inserted ampersands in the MasterDetail template, I ended up with errors in various places there a filename was derived from the input string. To help make this work better, there's also a new "extractLetters" method which pulls all the characters out of a string (effectively stripping whitespace and punctuation). In addition to the above 4 new string conversion methods, the templates have been updated to use them, and the template format documentation updated. Change-Id: I4d4e854ab78d63bc86b8eb0fb9d92246534615e7
* Add theme selection to New Android App template.Roman Nurik2012-07-279-17/+65
| | | | | | | | - Add a parameter to allow selecting the application theme. Includes backward-compatibility support using resource directory qualifiers. Default theme is Holo.Light.DarkActionBar. Change-Id: Id046a2806fba9ea8ae296859b6d76af18a312b9f
* Activity templates cleanup.Roman Nurik2012-07-194-2/+2
| | | | | | | | | | | | | | | | | This change cleans up the BlankActivity and MasterDetailFlow activity templates in the following ways: - Unused search icons are removed. - Many comments are added for a better explanation of what's going on. See http://code.google.com/p/android/issues/detail?id=34463 - Code and comments are in better alignment with Android code style and import order (per http://source.android.com/source/code-style.html) - Non-trivial BlankActivity templates now require API 11 instead of 14. More work TBD here. - Templates are more lint-friendly. - android:parentActivityName is added when building against API 16. Change-Id: Iba7b807c7567b161b0e50fb39306209172627c35
* Project template tweaksTor Norbye2012-07-023-0/+0
| | | | | | | | | | | | | | | | | | | | Fix code which derives a project name from an application name such that it skips invalid project name characters. For example, the application name can be "I/O", but the project name should default to just "IO". Second, fix the validator code such that when it is validating a template parameter constraint of "class", it validates it as a class name, not a package name (so you cannot enter dots for example). Third, replace the default project template icons with the standard app icons (for when you disable Create Custom Launcher Icons). Fourth, tweak the templates such that you don't have unused imports when you create an activity without navigation, and remove unused padding dimension resources. Change-Id: I524608bb6347b4275338ec935e8de56bf3184c23
* Miscellaneous wizard fixesTor Norbye2012-06-202-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add minSdk requirements on templates, and attempting to pick a template with a higher minimum SDK than the one used by the current project will result in a validation error message (and the Next button is disabled). Similarly, add a minSdk requirement on options, such as the BlankActivity's navigation type. This is used to block all navigation types except for "none", unless minSdkVersion >= 14. * Add a buildApi property, which the templates use to only conditionally write contents which requires a higher compilation target. For example, the values-v11 and values-v14 folders specifying Theme.Holo.Light and Theme.Holo.Light.DarkActionBar are only written if the build target is at least 11 and 14 respectively. * Fix some other minor issues which prevented the projects from compiling with low minSdkVersions and low build targets. * Replace the default simple activity's layout (which was just a <TextView> with a center gravity, with a <RelativeLayout> containing the <TextView> with center constraints * Make the code which combines the list of templates from extras/ and tools/ smarter; instead of just concatenating the two lists, it now compares them, and when they have the same names (same templates, different versions), it now chooses which one to use based on the template revision number in the metadata file. Moved some code out of TemplateHandler and into a new TemplateManager class, such that I could add metadata caching (since the code to merge templates in multiple files would repeatedly read and parse the metadata for each pair comparison.) Change-Id: I94fc4f754dd7125b5be5c78e61efcfc268f73af5
* Wizard tweaksTor Norbye2012-06-196-13/+9
| | | | | | | | | | | | | | | | | | | | Validate target location such that if the target directory exists, the wizard complains. Fix the icons for custom views and unit test projects such that they have the "+" icon badge indicating that something will be created. Update labels. Replace the single theme defintion which references DarkActionBar such that we have 3 styles, one for pre-11, one for 11-13 and one for 14+ which define the relevant light themes. Remove the unused dimensions in blank projects. Remove the (unused) "Include compatibility code" toggle. Change-Id: I3d42c9544170c7a33754b0e410e9f1421d5c323b
* Dependency support for the templatesTor Norbye2012-06-141-0/+1
| | | | Change-Id: Id6b0e5f65fc3a50b352423623332c47f7ab5085d
* Add format handling to the template wizardsTor Norbye2012-06-141-0/+2
| | | | | | | | | | | | | | | | This changeset adds a format attribute to the templates. When the ADT plugin reads a template file, and the format version is a higher number than one it knows about, it rejects the templates and informs the user to upgrade the plugin. This allows us to change the format of the templates incompatibly in the future without worrying about users with older versions of the plugin running into problems (because they upgraded the tools but not ADT). It also adds a revision number to each template which is used for the opposite purpose: we can tell if a template is a slightly older revision and then do some conditional handling. Change-Id: If6c49012a1beca44c3a05b3e880ffde70294a57e
* Allow project templates to be bundled separatelyTor Norbye2012-06-0415-0/+109
This changeset moves the various FreeMarker templates out of the ADT plugin and over into the tools install area. The code to instantiate templates is simplified a bit now that it no longer needs to both handle files on disk and files read out of the .jar. There's a new first page to the various template wizards which is shown if the tools are not up to date (specifically, if the $SDK/tools/templates/ directory does not exist). This page explains that the tools have to be updated, and the Next button is disabled until they are up to date. This CL also contains some other tweaks suggested by Roman to the activity-to-layout name mapping and misc code changes. Change-Id: I3bc65f54a6b79bbeedfb917a9d34ec0d312f3526