Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fed55bf authored by Tony Wickham's avatar Tony Wickham
Browse files

Add feature flag to disable light status bar

Bug: 32085545
Change-Id: I4860145b00893c20f7e37817e9659ccd90409966
parent 3f886406
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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) {
+10 −6
Original line number Diff line number Diff line
@@ -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,13 +63,16 @@ public class ColorExtractionService extends IntentService {
                    .generate();
            extractedColors.updateHotseatPalette(hotseatPalette);

            int statusBarHeight = getResources().getDimensionPixelSize(R.dimen.status_bar_height);
            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.
        String colorsString = extractedColors.encodeAsString();
+1 −1
Original line number Diff line number Diff line
@@ -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 = ",";

+2 −0
Original line number Diff line number Diff line
@@ -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;
}