diff options
| author | 2017-09-19 19:34:34 +0000 | |
|---|---|---|
| committer | 2017-09-19 19:34:34 +0000 | |
| commit | 91d904404a1eca523e4b82454278c5f9bde329f4 (patch) | |
| tree | 01c651293c21d4233112b620042a9e51b71298d6 | |
| parent | 3f9ab47f2d64474d5e0a45ee7663b6ae96931460 (diff) | |
| parent | b5f59fe7a0d75a95bdf315e6c572642fb505a79e (diff) | |
Merge "Fix navbar colors on power menu"
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index 4cbbbd6c2e90..189badfc42fc 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -1280,7 +1280,23 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn mGradientDrawable.setScreenSize(displaySize.x, displaySize.y); GradientColors colors = mColorExtractor.getColors(mKeyguardShowing ? WallpaperManager.FLAG_LOCK : WallpaperManager.FLAG_SYSTEM); - mGradientDrawable.setColors(colors, false); + updateColors(colors, false /* animate */); + } + + /** + * Updates background and system bars according to current GradientColors. + * @param colors Colors and hints to use. + * @param animate Interpolates gradient if true, just sets otherwise. + */ + private void updateColors(GradientColors colors, boolean animate) { + mGradientDrawable.setColors(colors, animate); + View decorView = getWindow().getDecorView(); + if (colors.supportsDarkText()) { + decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } else { + decorView.setSystemUiVisibility(0); + } } @Override @@ -1350,11 +1366,13 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn public void onColorsChanged(ColorExtractor extractor, int which) { if (mKeyguardShowing) { if ((WallpaperManager.FLAG_LOCK & which) != 0) { - mGradientDrawable.setColors(extractor.getColors(WallpaperManager.FLAG_LOCK)); + updateColors(extractor.getColors(WallpaperManager.FLAG_LOCK), + true /* animate */); } } else { if ((WallpaperManager.FLAG_SYSTEM & which) != 0) { - mGradientDrawable.setColors(extractor.getColors(WallpaperManager.FLAG_SYSTEM)); + updateColors(extractor.getColors(WallpaperManager.FLAG_SYSTEM), + true /* animate */); } } } |