diff options
author | Tor Norbye <tnorbye@google.com> | 2012-08-23 19:51:01 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-08-23 19:51:01 -0700 |
commit | 33c1e883ce229219268bb5584d4769106c736c39 (patch) | |
tree | f10ae6c90a401af12b8844ca65b06acb6183e3bc /templates/activities | |
parent | 1933bff778c986e4de21efcad3a041db61836efa (diff) | |
download | sdk-33c1e883ce229219268bb5584d4769106c736c39.zip sdk-33c1e883ce229219268bb5584d4769106c736c39.tar.gz sdk-33c1e883ce229219268bb5584d4769106c736c39.tar.bz2 |
Don't create a new title string for first activity in prj
When an activity is created as part of the New Project wizard,
don't ask the user for an activity title; instead, use the
project's name (@string/app_name).
Since I had to rev the format (to pass the is-new-project
context I also cleaned up the compatibility to-string handling
of booleans that should no longer be necessary.)
This fixes issue 36624: App name issue
Change-Id: I6b88b850e0147307db8a9e1585d670e31c261b4c
Diffstat (limited to 'templates/activities')
15 files changed, 43 insertions, 13 deletions
diff --git a/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl b/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl index 1c6fbd1..b8ae72e 100644 --- a/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl +++ b/templates/activities/BlankActivity/root/AndroidManifest.xml.ftl @@ -2,13 +2,17 @@ <application> <activity android:name=".${activityClass}" + <#if isNewProject> + android:label="@string/app_name" + <#else> android:label="@string/title_${activityToLayout(activityClass)}" + </#if> <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>> <#if parentActivityClass != ""> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="${parentActivityClass}" /> </#if> - <#if isLauncher?string == "true"> + <#if isLauncher> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/templates/activities/BlankActivity/root/res/values/strings.xml.ftl b/templates/activities/BlankActivity/root/res/values/strings.xml.ftl index 4018308..6c636d6 100644 --- a/templates/activities/BlankActivity/root/res/values/strings.xml.ftl +++ b/templates/activities/BlankActivity/root/res/values/strings.xml.ftl @@ -1,5 +1,7 @@ <resources> + <#if !isNewProject> <string name="title_${activityToLayout(activityClass)}">${activityTitle}</string> + </#if> <string name="menu_settings">Settings</string> diff --git a/templates/activities/BlankActivity/template.xml b/templates/activities/BlankActivity/template.xml index 77aae56..31e8bb3 100644 --- a/templates/activities/BlankActivity/template.xml +++ b/templates/activities/BlankActivity/template.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <template - format="1" - revision="1" + format="3" + revision="2" name="New Blank Activity" description="Creates a new blank activity, with optional inner navigation."> <dependency name="android-support-v4" revision="8" /> diff --git a/templates/activities/FullscreenActivity/root/AndroidManifest.xml.ftl b/templates/activities/FullscreenActivity/root/AndroidManifest.xml.ftl index 3142546..b909732 100644 --- a/templates/activities/FullscreenActivity/root/AndroidManifest.xml.ftl +++ b/templates/activities/FullscreenActivity/root/AndroidManifest.xml.ftl @@ -2,7 +2,11 @@ <application> <activity android:name=".${activityClass}" + <#if isNewProject> + android:label="@string/app_name" + <#else> android:label="@string/title_${simpleName}" + </#if> android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/FullscreenTheme" <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>> @@ -10,7 +14,7 @@ <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="${parentActivityClass}" /> </#if> - <#if isLauncher?string == "true"> + <#if isLauncher> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl b/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl index 78275fa..53ff7df 100644 --- a/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl +++ b/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl @@ -1,6 +1,8 @@ <resources> + <#if !isNewProject> <string name="title_${simpleName}">${activityTitle}</string> + </#if> <string name="dummy_button1">Button 1</string> <string name="dummy_button2">Button 2</string> <string name="dummy_content">DUMMY\nCONTENT</string> diff --git a/templates/activities/FullscreenActivity/template.xml b/templates/activities/FullscreenActivity/template.xml index 90367dd..bb2dbd5 100644 --- a/templates/activities/FullscreenActivity/template.xml +++ b/templates/activities/FullscreenActivity/template.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <template - format="1" - revision="1" + format="3" + revision="2" name="New Fullscreen Activity" description="Creates a new activity that shows and hides the system UI (status bar, navigation/system bar), and action bar, upon user interaction." minApi="3" diff --git a/templates/activities/LoginActivity/root/AndroidManifest.xml.ftl b/templates/activities/LoginActivity/root/AndroidManifest.xml.ftl index 3825bb4..c5f02d2 100644 --- a/templates/activities/LoginActivity/root/AndroidManifest.xml.ftl +++ b/templates/activities/LoginActivity/root/AndroidManifest.xml.ftl @@ -2,7 +2,11 @@ <application> <activity android:name=".${activityClass}" + <#if isNewProject> + android:label="@string/app_name" + <#else> android:label="@string/title_${simpleName}" + </#if> android:windowSoftInputMode="adjustResize|stateVisible" <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>> <#if parentActivityClass != ""> diff --git a/templates/activities/LoginActivity/root/res/values/strings.xml.ftl b/templates/activities/LoginActivity/root/res/values/strings.xml.ftl index 1410671..c2ad046 100644 --- a/templates/activities/LoginActivity/root/res/values/strings.xml.ftl +++ b/templates/activities/LoginActivity/root/res/values/strings.xml.ftl @@ -1,5 +1,7 @@ <resources> + <#if !isNewProject> <string name="title_${simpleName}">${activityTitle}</string> + </#if> <!-- Strings related to login --> <string name="prompt_email">Email</string> diff --git a/templates/activities/LoginActivity/template.xml b/templates/activities/LoginActivity/template.xml index 7df8895..600aa4e 100644 --- a/templates/activities/LoginActivity/template.xml +++ b/templates/activities/LoginActivity/template.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <template - format="1" - revision="1" + format="3" + revision="2" name="New Login Activity" description="Creates a new login activity, allowing users to enter an email address and password to login or register for your service." minApi="3" diff --git a/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl b/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl index 395b227..4707bd6 100644 --- a/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl +++ b/templates/activities/MasterDetailFlow/root/AndroidManifest.xml.ftl @@ -2,13 +2,17 @@ <application> <activity android:name=".${CollectionName}Activity" + <#if isNewProject> + android:label="@string/app_name" + <#else> android:label="@string/title_${collection_name}" + </#if> <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>> <#if parentActivityClass != ""> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="${parentActivityClass}" /> </#if> - <#if isLauncher?string == "true"> + <#if isLauncher> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/templates/activities/MasterDetailFlow/root/res/values/strings.xml.ftl b/templates/activities/MasterDetailFlow/root/res/values/strings.xml.ftl index 4f8aeca..8c555ae 100644 --- a/templates/activities/MasterDetailFlow/root/res/values/strings.xml.ftl +++ b/templates/activities/MasterDetailFlow/root/res/values/strings.xml.ftl @@ -1,4 +1,6 @@ <resources> + <#if !isNewProject> <string name="title_${collection_name}">${objectKindPlural}</string> + </#if> <string name="title_${detail_name}">${objectKind} Detail</string> </resources> diff --git a/templates/activities/MasterDetailFlow/template.xml b/templates/activities/MasterDetailFlow/template.xml index 19b7651..5c97b2b 100644 --- a/templates/activities/MasterDetailFlow/template.xml +++ b/templates/activities/MasterDetailFlow/template.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <template - format="1" - revision="1" + format="3" + revision="2" name="New Master/Detail Flow" minApi="11" description="Creates a new master/detail flow, which is two columns on tablets, and one column on smaller screens. This creates a master fragment, detail fragment, and two activities."> diff --git a/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl b/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl index 7f2efb8..9f78fcf 100644 --- a/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl +++ b/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl @@ -2,7 +2,11 @@ <application> <activity android:name=".${activityClass}" + <#if isNewProject> + android:label="@string/app_name" + <#else> android:label="@string/title_${simpleName}" + </#if> <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>> <#if parentActivityClass != ""> <meta-data android:name="android.support.PARENT_ACTIVITY" diff --git a/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl b/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl index 164c24f..bf881a3 100644 --- a/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl +++ b/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl @@ -1,5 +1,7 @@ <resources> + <#if !isNewProject> <string name="title_${simpleName}">${activityTitle}</string> + </#if> <!-- Strings related to Settings --> diff --git a/templates/activities/SettingsActivity/template.xml b/templates/activities/SettingsActivity/template.xml index f6c8dfe..a5d084f 100644 --- a/templates/activities/SettingsActivity/template.xml +++ b/templates/activities/SettingsActivity/template.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <template - format="1" - revision="1" + format="3" + revision="2" name="New Settings Activity" description="Creates a new application settings activity." minApi="4" |