From f926c30cd3c9284163c64c08f31a52e190eb53fb Mon Sep 17 00:00:00 2001 From: Clark Scheff Date: Mon, 25 Aug 2014 11:27:42 -0700 Subject: Revert "Use ArrayListExtra for broadcasting theme changes [2/2]" This reverts commit ebf8f37515c23a167cef2bb8cff04854c52fd35b. Change-Id: If80e3bc0443fa9e79c085e9251f4be0a10730397 --- AndroidManifest.xml | 3 ++ .../android/launcher3/ThemeChangedReceiver.java | 45 ++++------------------ 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0dd98d68b..fcf3baf8f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -197,6 +197,9 @@ + + + diff --git a/src/com/android/launcher3/ThemeChangedReceiver.java b/src/com/android/launcher3/ThemeChangedReceiver.java index c7a98c5ab..19c2e226d 100644 --- a/src/com/android/launcher3/ThemeChangedReceiver.java +++ b/src/com/android/launcher3/ThemeChangedReceiver.java @@ -19,53 +19,22 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import static com.android.launcher3.WidgetPreviewLoader.CacheDb.DB_NAME; - import java.io.File; -import java.util.ArrayList; - -public class ThemeChangedReceiver extends BroadcastReceiver { - private static final String EXTRA_COMPONENTS = "components"; - public static final String MODIFIES_ICONS = "mods_icons"; - public static final String MODIFIES_FONTS = "mods_fonts"; - public static final String MODIFIES_OVERLAYS = "mods_overlays"; +import static com.android.launcher3.WidgetPreviewLoader.CacheDb.DB_NAME; +public class ThemeChangedReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { - // components is a string array of the components that changed - ArrayList components = intent.getStringArrayListExtra(EXTRA_COMPONENTS); - if (isInterestingThemeChange(components)) { - LauncherAppState app = LauncherAppState.getInstance(); - clearWidgetPreviewCache(context); - app.recreateWidgetPreviewDb(); - app.getIconCache().flush(); - app.getModel().forceReload(); - } + LauncherAppState app = LauncherAppState.getInstance(); + clearWidgetPreviewCache(context); + app.recreateWidgetPreviewDb(); + app.getIconCache().flush(); + app.getModel().forceReload(); } - /** - * We consider this an "interesting" theme change if it modifies icons, overlays, or fonts. - * @param components - * @return - */ - private boolean isInterestingThemeChange(ArrayList components) { - if (components != null) { - for (String component : components) { - if (component.equals(MODIFIES_ICONS) || - component.equals(MODIFIES_FONTS) || - component.equals(MODIFIES_OVERLAYS)) { - return true; - } - } - } - return false; - } - - /** * Normally we could use context.deleteDatabase() but this db is in cache/ so we'll * manually delete it and the journal ourselves. - * * @param context */ private void clearWidgetPreviewCache(Context context) { -- cgit v1.2.3 From 21df88b3e47c6ce768ae2f414c2eaf56b39da7ce Mon Sep 17 00:00:00 2001 From: Clark Scheff Date: Mon, 25 Aug 2014 11:27:55 -0700 Subject: Revert "Use theme change categories and clear widget preview cache" This reverts commit b52694e4fdd3c8ee524b5f6f870697e40061b2a6. Change-Id: I69bff363280ea69ee83dea3a8f2ef2d0d95a7be0 --- AndroidManifest.xml | 3 -- .../android/launcher3/ThemeChangedReceiver.java | 40 ++++++++++++---------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fcf3baf8f..0dd98d68b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -197,9 +197,6 @@ - - - diff --git a/src/com/android/launcher3/ThemeChangedReceiver.java b/src/com/android/launcher3/ThemeChangedReceiver.java index 19c2e226d..134a28559 100644 --- a/src/com/android/launcher3/ThemeChangedReceiver.java +++ b/src/com/android/launcher3/ThemeChangedReceiver.java @@ -19,30 +19,34 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import java.io.File; +public class ThemeChangedReceiver extends BroadcastReceiver { + private static final String EXTRA_COMPONENTS = "components"; -import static com.android.launcher3.WidgetPreviewLoader.CacheDb.DB_NAME; + public static final String MODIFIES_ICONS = "mods_icons"; + public static final String MODIFIES_FONTS = "mods_fonts"; + public static final String MODIFIES_OVERLAYS = "mods_overlays"; -public class ThemeChangedReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { - LauncherAppState app = LauncherAppState.getInstance(); - clearWidgetPreviewCache(context); - app.recreateWidgetPreviewDb(); - app.getIconCache().flush(); - app.getModel().forceReload(); + // components is a '|' delimited string of the components that changed + // due to a theme change. + String components = intent.getStringExtra(EXTRA_COMPONENTS); + if (components != null) { + LauncherAppState.setApplicationContext(context.getApplicationContext()); + LauncherAppState app = LauncherAppState.getInstance(); + if (isInterestingThemeChange(components)) { + app.getIconCache().flush(); + app.getModel().forceReload(); + } + } } /** - * Normally we could use context.deleteDatabase() but this db is in cache/ so we'll - * manually delete it and the journal ourselves. - * @param context + * We consider this an "interesting" theme change if it modifies icons, overlays, or fonts. + * @param components + * @return */ - private void clearWidgetPreviewCache(Context context) { - File[] files = context.getCacheDir().listFiles(); - if (files != null) { - for (File f : files) { - if (!f.isDirectory() && f.getName().startsWith(DB_NAME)) f.delete(); - } - } + private boolean isInterestingThemeChange(String components) { + return components.contains(MODIFIES_ICONS) || components.contains(MODIFIES_FONTS) || + components.contains(MODIFIES_OVERLAYS); } } -- cgit v1.2.3 From 70563dfacb2e88cc01d81fa98d19e73d4aab6aa6 Mon Sep 17 00:00:00 2001 From: Clark Scheff Date: Mon, 25 Aug 2014 11:28:03 -0700 Subject: Revert "Handle theme changes" This reverts commit 64718d775ce8322915d143adb9a0f1ea3160e9e3. Change-Id: Ibf92232dfa8ee96aafecc4b4e49fc55cfb21c229 --- AndroidManifest.xml | 6 --- src/com/android/launcher3/Launcher.java | 2 +- .../android/launcher3/ThemeChangedReceiver.java | 52 ---------------------- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 src/com/android/launcher3/ThemeChangedReceiver.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0dd98d68b..3de1bdfc3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -194,12 +194,6 @@ - - - - - - Date: Wed, 27 Aug 2014 17:18:26 -0700 Subject: Fix - Workspace background gradient Repro: - Open App Drawer - Launcher any app - Press back (User should be returned to the App Drawer) - Press back again (User should be returned to the Home Screen) - Note gradient near status bar (Home Screen gradient is missing!) - Press home - Note Home Screen gradient reappears Change-Id: Ib24d94c2deba06f872f42bfffff78317844dd731 --- src/com/android/launcher3/Launcher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 66b94e2cb..2223a5c1e 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2754,6 +2754,8 @@ public class Launcher extends Activity if (mAppsCustomizeContent.getContentType() == AppsCustomizePagedView.ContentType.Applications) { showWorkspace(true); + // Background was set to gradient in onPause(), restore to black if in all apps. + setWorkspaceBackground(mState == State.WORKSPACE); } else { showOverviewMode(true); } -- cgit v1.2.3 From 93716e36397322fa24cbd3498c521732702d8836 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 1 Sep 2014 01:00:35 +0300 Subject: Automatic translation import Change-Id: I6bbc7a3c3ac320c7e70ca2ad1e4191483291a5be --- res/values-af/cm_strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values-af/cm_strings.xml b/res/values-af/cm_strings.xml index 9d6173e3b..ef4a5a1c4 100644 --- a/res/values-af/cm_strings.xml +++ b/res/values-af/cm_strings.xml @@ -19,7 +19,7 @@ LANSEERDER INSTELLINGS TUIS SKERM INSTELLINGS LAAI INSTELLINGS - PROG INSTELLINGS + PROGRAM INSTELLINGS AAN AF Google Now -- cgit v1.2.3