diff options
author | Tor Norbye <tnorbye@google.com> | 2012-06-22 14:19:51 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-07-02 08:44:14 -0700 |
commit | e9db0a86e766f52a9cef38f7ad05a32185f0f953 (patch) | |
tree | 25c33551b9336e410ac46b694095df330c144c05 /templates/activities/BlankActivity/root/src/app_package | |
parent | 2b78fa53ccd6b5422c66b33ff35db3a0330f2c38 (diff) | |
download | sdk-e9db0a86e766f52a9cef38f7ad05a32185f0f953.zip sdk-e9db0a86e766f52a9cef38f7ad05a32185f0f953.tar.gz sdk-e9db0a86e766f52a9cef38f7ad05a32185f0f953.tar.bz2 |
Project template tweaks
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
Diffstat (limited to 'templates/activities/BlankActivity/root/src/app_package')
-rw-r--r-- | templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl index 70cc3f7..6021829 100644 --- a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl +++ b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl @@ -3,8 +3,10 @@ package ${packageName}; import android.os.Bundle; import android.app.Activity; import android.view.Menu; +<#if parentActivityClass != ""> import android.view.MenuItem; import android.support.v4.app.NavUtils; +</#if> public class ${activityClass} extends Activity { @@ -22,5 +24,7 @@ public class ${activityClass} extends Activity { getMenuInflater().inflate(R.menu.${menuName}, menu); return true; } +<#if parentActivityClass != ""> <#include "include_onOptionsItemSelected.java.ftl"> +</#if> } |