summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-10-13 00:41:57 (GMT)
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-10-13 00:41:57 (GMT)
commit1d29c6f7d2fab3c55ac2267957eb3cba3f7eddab (patch)
treead444dfcf85d3324f71179ec2c4305c9f3f30f9a
parentcf6195268d3c1f190318b3220d321fb910349e51 (diff)
parent0fed55bf031087474a3833a3e28f4263c8dc7959 (diff)
downloadandroid_packages_apps_Trebuchet-1d29c6f7d2fab3c55ac2267957eb3cba3f7eddab.zip
android_packages_apps_Trebuchet-1d29c6f7d2fab3c55ac2267957eb3cba3f7eddab.tar.gz
android_packages_apps_Trebuchet-1d29c6f7d2fab3c55ac2267957eb3cba3f7eddab.tar.bz2
Merge "Add feature flag to disable light status bar" into ub-launcher3-calgary-polish
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/dynamicui/ColorExtractionService.java16
-rw-r--r--src/com/android/launcher3/dynamicui/ExtractedColors.java2
-rw-r--r--src_config/com/android/launcher3/config/FeatureFlags.java2
4 files changed, 16 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c73a7a6..544aef2 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -499,9 +499,9 @@ public class Launcher extends Activity
* @param activate if true, make sure the status bar is light, otherwise base on wallpaper.
*/
public void activateLightStatusBar(boolean activate) {
- boolean lightStatusBar = activate
- || mExtractedColors.getColor(ExtractedColors.STATUS_BAR_INDEX,
- ExtractedColors.DEFAULT_DARK) == ExtractedColors.DEFAULT_LIGHT;
+ boolean lightStatusBar = activate || (FeatureFlags.LIGHT_STATUS_BAR
+ && mExtractedColors.getColor(ExtractedColors.STATUS_BAR_INDEX,
+ ExtractedColors.DEFAULT_DARK) == ExtractedColors.DEFAULT_LIGHT);
int oldSystemUiFlags = getWindow().getDecorView().getSystemUiVisibility();
int newSystemUiFlags = oldSystemUiFlags;
if (lightStatusBar) {
diff --git a/src/com/android/launcher3/dynamicui/ColorExtractionService.java b/src/com/android/launcher3/dynamicui/ColorExtractionService.java
index c15b710..1369f60 100644
--- a/src/com/android/launcher3/dynamicui/ColorExtractionService.java
+++ b/src/com/android/launcher3/dynamicui/ColorExtractionService.java
@@ -27,6 +27,7 @@ import android.support.v7.graphics.Palette;
import com.android.launcher3.LauncherProvider;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
+import com.android.launcher3.config.FeatureFlags;
/**
* Extracts colors from the wallpaper, and saves results to {@link LauncherProvider}.
@@ -62,12 +63,15 @@ public class ColorExtractionService extends IntentService {
.generate();
extractedColors.updateHotseatPalette(hotseatPalette);
- int statusBarHeight = getResources().getDimensionPixelSize(R.dimen.status_bar_height);
- Palette statusBarPalette = Palette.from(wallpaper)
- .setRegion(0, 0, wallpaper.getWidth(), statusBarHeight)
- .clearFilters()
- .generate();
- extractedColors.updateStatusBarPalette(statusBarPalette);
+ if (FeatureFlags.LIGHT_STATUS_BAR) {
+ int statusBarHeight = getResources()
+ .getDimensionPixelSize(R.dimen.status_bar_height);
+ Palette statusBarPalette = Palette.from(wallpaper)
+ .setRegion(0, 0, wallpaper.getWidth(), statusBarHeight)
+ .clearFilters()
+ .generate();
+ extractedColors.updateStatusBarPalette(statusBarPalette);
+ }
}
// Save the extracted colors and wallpaper id to LauncherProvider.
diff --git a/src/com/android/launcher3/dynamicui/ExtractedColors.java b/src/com/android/launcher3/dynamicui/ExtractedColors.java
index 4db0797..6a3011d 100644
--- a/src/com/android/launcher3/dynamicui/ExtractedColors.java
+++ b/src/com/android/launcher3/dynamicui/ExtractedColors.java
@@ -47,7 +47,7 @@ public class ExtractedColors {
// public static final int MUTED_LIGHT_INDEX = 7;
public static final int NUM_COLOR_PROFILES = 2;
- private static final int VERSION = 2;
+ private static final int VERSION = 1;
private static final String COLOR_SEPARATOR = ",";
diff --git a/src_config/com/android/launcher3/config/FeatureFlags.java b/src_config/com/android/launcher3/config/FeatureFlags.java
index fe7bcbd..8ee5497 100644
--- a/src_config/com/android/launcher3/config/FeatureFlags.java
+++ b/src_config/com/android/launcher3/config/FeatureFlags.java
@@ -37,4 +37,6 @@ public final class FeatureFlags {
public static final boolean NO_ALL_APPS_ICON = true;
// When enabled fling down gesture on the first workspace triggers search.
public static final boolean PULLDOWN_SEARCH = false;
+ // When enabled the status bar may show dark icons based on the top of the wallpaper.
+ public static final boolean LIGHT_STATUS_BAR = false;
}