aboutsummaryrefslogtreecommitdiffstats
path: root/templates/activities/FullscreenActivity
diff options
context:
space:
mode:
authorScott Barta <sbarta@google.com>2013-04-15 12:42:56 -0700
committerScott Barta <sbarta@google.com>2013-04-26 15:14:32 -0700
commit5afb360a339d083d0edc7b78c04f2dcfbd2a7f41 (patch)
tree477b9bcff9eafa3e5bb8d3bb1139c0f9fd2b21aa /templates/activities/FullscreenActivity
parent31baa1d95b494108670d0033b4724ef78f41ef85 (diff)
downloadsdk-5afb360a339d083d0edc7b78c04f2dcfbd2a7f41.zip
sdk-5afb360a339d083d0edc7b78c04f2dcfbd2a7f41.tar.gz
sdk-5afb360a339d083d0edc7b78c04f2dcfbd2a7f41.tar.bz2
Modified templates for Gradle projects
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
Diffstat (limited to 'templates/activities/FullscreenActivity')
-rw-r--r--templates/activities/FullscreenActivity/globals.xml.ftl3
-rw-r--r--templates/activities/FullscreenActivity/recipe.xml.ftl21
-rw-r--r--templates/activities/FullscreenActivity/root/res/values/attrs.xml2
3 files changed, 17 insertions, 9 deletions
diff --git a/templates/activities/FullscreenActivity/globals.xml.ftl b/templates/activities/FullscreenActivity/globals.xml.ftl
index a416d3a..6d73e17 100644
--- a/templates/activities/FullscreenActivity/globals.xml.ftl
+++ b/templates/activities/FullscreenActivity/globals.xml.ftl
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
<globals>
+ <global id="projectOut" value="." />
+ <global id="manifestOut" value="." />
<global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+ <global id="resOut" value="res" />
<global id="simpleName" value="${activityToLayout(activityClass)}" />
</globals>
diff --git a/templates/activities/FullscreenActivity/recipe.xml.ftl b/templates/activities/FullscreenActivity/recipe.xml.ftl
index 1e41e5f..b3e1f20 100644
--- a/templates/activities/FullscreenActivity/recipe.xml.ftl
+++ b/templates/activities/FullscreenActivity/recipe.xml.ftl
@@ -1,16 +1,21 @@
<?xml version="1.0"?>
<recipe>
- <merge from="AndroidManifest.xml.ftl" />
+ <merge from="AndroidManifest.xml.ftl"
+ to="${manifestOut}/AndroidManifest.xml" />
- <merge from="res/values/attrs.xml" />
- <merge from="res/values/colors.xml" />
- <merge from="res/values/styles.xml" />
- <merge from="res/values-v11/styles.xml" />
+ <merge from="res/values/attrs.xml"
+ to="${resOut}/values/attrs.xml" />
+ <merge from="res/values/colors.xml"
+ to="${resOut}/values/colors.xml" />
+ <merge from="res/values/styles.xml"
+ to="${resOut}/values/styles.xml" />
+ <merge from="res/values-v11/styles.xml"
+ to="${resOut}/values-v11/styles.xml" />
<instantiate from="res/layout/activity_fullscreen.xml.ftl"
- to="res/layout/${layoutName}.xml" />
+ to="${resOut}/layout/${layoutName}.xml" />
<merge from="res/values/strings.xml.ftl"
- to="res/values/strings.xml" />
+ to="${resOut}/values/strings.xml" />
<instantiate from="src/app_package/FullscreenActivity.java.ftl"
to="${srcOut}/${activityClass}.java" />
@@ -21,5 +26,5 @@
<instantiate from="src/app_package/util/SystemUiHiderHoneycomb.java.ftl"
to="${srcOut}/util/SystemUiHiderHoneycomb.java" />
- <open file="res/layout/${layoutName}.xml" />
+ <open file="${resOut}/layout/${layoutName}.xml" />
</recipe>
diff --git a/templates/activities/FullscreenActivity/root/res/values/attrs.xml b/templates/activities/FullscreenActivity/root/res/values/attrs.xml
index 0201588..2cf1a1a 100644
--- a/templates/activities/FullscreenActivity/root/res/values/attrs.xml
+++ b/templates/activities/FullscreenActivity/root/res/values/attrs.xml
@@ -9,4 +9,4 @@
<attr name="buttonBarButtonStyle" format="reference" />
</declare-styleable>
-</resources> \ No newline at end of file
+</resources>