summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Scheff <clark@cyngn.com>2014-10-28 22:43:02 (GMT)
committerClark Scheff <clark@cyngn.com>2014-10-31 14:42:26 (GMT)
commitaf6bd9fe6d94fc7b3834602fcd643916f1c923ae (patch)
tree893e841166f75c787e5fa15c4c450e5b45f40986
parentc6c9991519a862eee6cc6c0a30b2ef187619c1db (diff)
downloadandroid_packages_apps_Trebuchet-af6bd9fe6d94fc7b3834602fcd643916f1c923ae.zip
android_packages_apps_Trebuchet-af6bd9fe6d94fc7b3834602fcd643916f1c923ae.tar.gz
android_packages_apps_Trebuchet-af6bd9fe6d94fc7b3834602fcd643916f1c923ae.tar.bz2
Launch theme chooser that supports cyngn.intent.category.APP_THEMES
If no activity is found that matches the intent with that category we will launch the theme settings. Change-Id: I6c210ff2f38c58a76719cd8625955026fdd6daa0
-rw-r--r--src/com/android/launcher3/Launcher.java13
-rw-r--r--src/com/android/launcher3/OverviewSettingsPanel.java1
2 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index d56eda5..1d1208f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1327,9 +1327,16 @@ public class Launcher extends Activity
}
protected void startThemeSettings() {
- Intent settings = new Intent().setClassName(OverviewSettingsPanel.ANDROID_SETTINGS,
- OverviewSettingsPanel.THEME_SETTINGS);
- startActivity(settings);
+ Intent chooser = new Intent(Intent.ACTION_MAIN)
+ .addCategory(OverviewSettingsPanel.THEME_CHOOSER_CATEGORY)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ try {
+ startActivity(chooser);
+ } catch (ActivityNotFoundException e) {
+ Intent settings = new Intent().setClassName(OverviewSettingsPanel.ANDROID_SETTINGS,
+ OverviewSettingsPanel.THEME_SETTINGS);
+ startActivity(settings);
+ }
if (mWorkspace.isInOverviewMode()) {
mWorkspace.exitOverviewMode(false);
diff --git a/src/com/android/launcher3/OverviewSettingsPanel.java b/src/com/android/launcher3/OverviewSettingsPanel.java
index f0a568b..ef12b50 100644
--- a/src/com/android/launcher3/OverviewSettingsPanel.java
+++ b/src/com/android/launcher3/OverviewSettingsPanel.java
@@ -20,6 +20,7 @@ public class OverviewSettingsPanel {
"com.android.settings.applications.ProtectedAppsActivity";
public static final String THEME_SETTINGS =
"com.android.settings.Settings$ThemeSettingsActivity";
+ public static final String THEME_CHOOSER_CATEGORY = "cyngn.intent.category.APP_THEMES";
public static final int HOME_SETTINGS_POSITION = 0;
public static final int DRAWER_SETTINGS_POSITION = 1;
public static final int APP_SETTINGS_POSITION = 2;