diff options
author | Roman Nurik <romannurik@google.com> | 2012-07-26 09:55:14 -0700 |
---|---|---|
committer | Roman Nurik <romannurik@google.com> | 2012-07-26 09:55:14 -0700 |
commit | d6d6285e654b49ee4233ba5591e74b95f6eee5df (patch) | |
tree | f37ae0fd14bf19856183c465b5a490fac1388e86 /templates/activities | |
parent | 3d1fd6f05a58463a8d56f7ba374240a093a061d0 (diff) | |
download | sdk-d6d6285e654b49ee4233ba5591e74b95f6eee5df.zip sdk-d6d6285e654b49ee4233ba5591e74b95f6eee5df.tar.gz sdk-d6d6285e654b49ee4233ba5591e74b95f6eee5df.tar.bz2 |
New activity template parameter making CATEGORY_LAUNCHER optional.
- Adds a new template parameter isLauncher to both current activity templates
that determines whether or not the activities will have CATEGORY_LAUNCHER
intent filters.
- Re-arranges some of the template parameters for better consistency
and logical ordering.
Change-Id: I2dd11776a838e727ad7f74dc0014fde235cfc8cb
Diffstat (limited to 'templates/activities')
4 files changed, 43 insertions, 27 deletions
diff --git a/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl b/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl index 30da501..3aa1627 100644 --- a/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl +++ b/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl @@ -7,7 +7,8 @@ <#if parentActivityClass != ""> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="${parentActivityClass}" /> - <#else> + </#if> + <#if isLauncher> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/templates/activities/BlankActivity/template.xml b/templates/activities/BlankActivity/template.xml index bf09e13..77aae56 100644 --- a/templates/activities/BlankActivity/template.xml +++ b/templates/activities/BlankActivity/template.xml @@ -27,6 +27,30 @@ help="The name of the layout to create for the activity" /> <parameter + id="activityTitle" + name="Title" + type="string" + constraints="nonempty" + default="MainActivity" + suggest="${activityClass}" + help="The name of the activity. For launcher activities, the application title." /> + + <parameter + id="isLauncher" + name="Launcher Activity" + type="boolean" + default="false" + help="If true, this activity will have a CATEGORY_LAUNCHER intent filter, making it visible in the launcher" /> + + <parameter + id="parentActivityClass" + name="Hierarchical Parent" + type="string" + constraints="activity|exists|empty" + default="" + help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" /> + + <parameter id="navType" name="Navigation Type" type="enum" @@ -40,23 +64,6 @@ </parameter> <parameter - id="parentActivityClass" - name="Hierarchical Parent" - type="string" - constraints="activity|exists|empty" - default="" - help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" /> - - <parameter - id="activityTitle" - name="Title" - type="string" - constraints="nonempty" - default="MainActivity" - suggest="${activityClass}" - help="The name of the activity. For launcher activities, the application title." /> - - <parameter id="packageName" name="Package name" type="string" diff --git a/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl b/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl index 3bd38b8..15ed087 100644 --- a/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl +++ b/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl @@ -7,7 +7,8 @@ <#if parentActivityClass != ""> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="${parentActivityClass}" /> - <#else> + </#if> + <#if isLauncher> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/templates/activities/MasterDetailFlow/template.xml b/templates/activities/MasterDetailFlow/template.xml index f158d14..19b7651 100644 --- a/templates/activities/MasterDetailFlow/template.xml +++ b/templates/activities/MasterDetailFlow/template.xml @@ -30,14 +30,6 @@ help="Other examples are 'People', 'Books', etc." /> <parameter - id="parentActivityClass" - name="Hierarchical Parent" - type="string" - constraints="activity|exists|empty" - default="" - help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" /> - - <parameter id="activityTitle" name="Title" type="string" @@ -46,6 +38,21 @@ default="Items" /> <parameter + id="isLauncher" + name="Launcher Activity" + type="boolean" + default="false" + help="If true, the primary activity in the flow will have a CATEGORY_LAUNCHER intent filter, making it visible in the launcher" /> + + <parameter + id="parentActivityClass" + name="Hierarchical Parent" + type="string" + constraints="activity|exists|empty" + default="" + help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" /> + + <parameter id="packageName" name="Package name" type="string" |