Defining a dark theme for launcher

> Removing the code for LIGHT_STATUS_BAR as that will be controlled by the theme
> Updating icon cache to always use transparent background for low-res, as the
theme can change the bg color

Change-Id: Iab64ec29cab629ee515af22ec15b95d3f40a9df5
This commit is contained in:
Sunny Goyal
2017-05-24 13:19:15 -07:00
parent 94652a207f
commit 368ae77201
12 changed files with 63 additions and 89 deletions

View File

@@ -71,6 +71,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
private final Launcher mLauncher;
private final VerticalPullDetector mDetector;
private final ArgbEvaluator mEvaluator;
private final boolean mIsDarkTheme;
// 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
@@ -112,6 +113,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
mEvaluator = new ArgbEvaluator();
mAllAppsBackgroundColor = Themes.getAttrColor(l, android.R.attr.colorPrimary);
mLauncher.getExtractedColors().addOnChangeListener(this);
mIsDarkTheme = Themes.getAttrBoolean(mLauncher, R.attr.isPrimaryColorDark);
}
@Override
@@ -275,9 +277,9 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
}
private void updateLightStatusBar(float shift) {
// Do not modify status bar on landscape as all apps is not full bleed.
if (!FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS
&& mLauncher.getDeviceProfile().isVerticalBarLayout()) {
// Do not modify status bar in dark theme or on landscape as all apps is not full bleed.
if (mIsDarkTheme || (!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