aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorJosiah Gaskin <josiahgaskin@google.com>2014-02-05 11:35:57 -0800
committerJosiah Gaskin <josiahgaskin@google.com>2014-02-05 11:48:00 -0800
commitf63407b14ab4390c826d16923aa721909c2e48b0 (patch)
tree71bf9b21ad7fc69842993e1f7db80c0216afdf89 /eclipse/plugins
parent3e9ad28ef8c8ec65ff90d1237c3e0bc4acc10073 (diff)
downloadsdk-f63407b14ab4390c826d16923aa721909c2e48b0.zip
sdk-f63407b14ab4390c826d16923aa721909c2e48b0.tar.gz
sdk-f63407b14ab4390c826d16923aa721909c2e48b0.tar.bz2
Conditionally use AppCompat theme
When creating a new project, if the user wants to create an activity the wizard will ask the template system to use the AppCompat themes. Change-Id: I5086c25b1979ebe79ff750884a84e282f17a3ee5
Diffstat (limited to 'eclipse/plugins')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
index 56bc955..2c8d87b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
@@ -75,6 +75,7 @@ public class NewProjectWizard extends TemplateWizard {
static final String CATEGORY_PROJECTS = "projects"; //$NON-NLS-1$
static final String CATEGORY_ACTIVITIES = "activities"; //$NON-NLS-1$
static final String CATEGORY_OTHER = "other"; //$NON-NLS-1$
+ static final String ATTR_APP_COMPAT = "appCompat"; //$NON-NLS-1$
/**
* Reserved file name for the launcher icon, resolves to the xhdpi version
*
@@ -268,6 +269,11 @@ public class NewProjectWizard extends TemplateWizard {
Map<String, Object> paramMap = new HashMap<String, Object>();
addProjectInfo(paramMap);
TemplateHandler.addDirectoryParameters(paramMap, getProject());
+ // We don't know at this point whether the activity is going to need
+ // AppCompat so we just assume that it will.
+ if (mValues.createActivity) {
+ paramMap.put(ATTR_APP_COMPAT, true);
+ }
return template.render(mProject, paramMap);
}