aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorJosiah Gaskin <josiahgaskin@google.com>2014-02-06 17:57:46 -0800
committerJosiah Gaskin <josiahgaskin@google.com>2014-02-06 17:57:46 -0800
commitd83a68033d287a672942502c3acf59e3c6f6679d (patch)
tree869a0bf2a3638f9432fca80e12676aee014c6b71 /eclipse/plugins
parent152c438f4bceecbed74b18f222b87698501edf41 (diff)
downloadsdk-d83a68033d287a672942502c3acf59e3c6f6679d.zip
sdk-d83a68033d287a672942502c3acf59e3c6f6679d.tar.gz
sdk-d83a68033d287a672942502c3acf59e3c6f6679d.tar.bz2
Fix handling of higher-API New Projects
Better handling for inclusion of AppCompat and usage of AppCompat themes. Now we only include AppCompat and use the theme if: We want to create an activity, and API < 14. Change-Id: I23d3932cc7d098d5dcd60d2cb24991ec876da0b6
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.java9
1 files changed, 8 insertions, 1 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 2c8d87b..d350a00 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
@@ -23,6 +23,7 @@ import com.android.annotations.VisibleForTesting;
import com.android.assetstudiolib.GraphicGenerator;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.actions.AddSupportJarAction;
import com.android.ide.eclipse.adt.internal.assetstudio.AssetType;
import com.android.ide.eclipse.adt.internal.assetstudio.ConfigureAssetSetPage;
import com.android.ide.eclipse.adt.internal.assetstudio.CreateAssetSetWizardState;
@@ -271,8 +272,14 @@ public class NewProjectWizard extends TemplateWizard {
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) {
+ if (mValues.createActivity && mValues.minSdkLevel < 14) {
paramMap.put(ATTR_APP_COMPAT, true);
+ getFinalizingActions().add(new Runnable() {
+ @Override
+ public void run() {
+ AddSupportJarAction.installAppCompatLibrary(mProject, true);
+ }
+ });
}
return template.render(mProject, paramMap);