diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-06-20 10:03:56 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-06-20 10:55:27 -0700 |
commit | 8392c823a938d527ac826904c0e8dbe7310d6176 (patch) | |
tree | 116429c30228de63782172efc2daf0144c39f87e /src/com/android/launcher3/allapps | |
parent | 7e2e2aa80baa4458e086f59e8c55ee016174593c (diff) | |
download | android_packages_apps_Trebuchet-8392c823a938d527ac826904c0e8dbe7310d6176.tar.gz android_packages_apps_Trebuchet-8392c823a938d527ac826904c0e8dbe7310d6176.tar.bz2 android_packages_apps_Trebuchet-8392c823a938d527ac826904c0e8dbe7310d6176.zip |
Fixing various system UI flags not getting updated properly on theme changes.
SystemUiController manages various system UI flags in priorty order and merges
all the states before applying the syste flags.
Fixing WallpaperColors when it was not handing wallpaper change properly in
some cases
Change-Id: I915442818e7888c97c81f63c8ea9f3c13053eb2c
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 2d8310bbe..faadce4c9 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -28,6 +28,7 @@ import com.android.launcher3.graphics.GradientView; import com.android.launcher3.graphics.ScrimView; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; +import com.android.launcher3.util.SystemUiController; import com.android.launcher3.util.Themes; import com.android.launcher3.util.TouchController; @@ -71,7 +72,6 @@ public class AllAppsTransitionController implements TouchController, VerticalPul private final VerticalPullDetector mDetector; private final ArgbEvaluator mEvaluator; private final boolean mIsDarkTheme; - private final boolean mIsWorkspaceDarkText; // Animation in this class is controlled by a single variable {@link mProgress}. // Visually, it represents top y coordinate of the all apps container if multiplied with @@ -114,7 +114,6 @@ public class AllAppsTransitionController implements TouchController, VerticalPul mEvaluator = new ArgbEvaluator(); mAllAppsBackgroundColor = Themes.getAttrColor(l, android.R.attr.colorPrimary); mIsDarkTheme = Themes.getAttrBoolean(mLauncher, R.attr.isMainColorDark); - mIsWorkspaceDarkText = Themes.getAttrBoolean(mLauncher, R.attr.isWorkspaceDarkText); } @Override @@ -278,15 +277,21 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } private void updateLightStatusBar(float shift) { - // Do not modify status bar in dark theme or on landscape as all apps is not full bleed. - if (mIsDarkTheme || mIsWorkspaceDarkText || (!FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS - && mLauncher.getDeviceProfile().isVerticalBarLayout())) { + // Do not modify status bar on landscape as all apps is not full bleed. + if (!FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS + && mLauncher.getDeviceProfile().isVerticalBarLayout()) { return; } - // Use a light status bar (dark icons) if all apps is behind at least half of the status - // bar. If the status bar is already light due to wallpaper extraction, keep it that way. - boolean forceLight = shift <= mStatusBarHeight / 2; - mLauncher.activateLightSystemBars(forceLight, true /* statusBar */, true /* navBar */); + + // Use a light system UI (dark icons) if all apps is behind at least half of the status bar. + boolean forceChange = shift <= mStatusBarHeight / 2; + if (forceChange) { + mLauncher.getSystemUiController().updateUiState( + SystemUiController.UI_STATE_ALL_APPS, !mIsDarkTheme); + } else { + mLauncher.getSystemUiController().updateUiState( + SystemUiController.UI_STATE_ALL_APPS, 0); + } } private void updateAllAppsBg(float progress) { |