Merge "Supporting dark theme hint for wallpaper colors." into ub-launcher3-dorval-polish

This commit is contained in:
TreeHugger Robot 2017-07-10 19:33:30 +00:00 committed by Android (Google) Code Review
commit 0946fc7af0
2 changed files with 4 additions and 3 deletions

View File

@ -21,6 +21,7 @@ package com.android.launcher3.compat;
public class WallpaperColorsCompat {
public static final int HINT_SUPPORTS_DARK_TEXT = 0x1;
public static final int HINT_SUPPORTS_DARK_THEME = 0x2;
private final int mPrimaryColor;
private final int mSecondaryColor;

View File

@ -81,9 +81,9 @@ public class WallpaperColorInfo implements WallpaperManagerCompat.OnColorsChange
mSupportsDarkText = wallpaperColors != null
? (wallpaperColors.getColorHints()
& WallpaperColorsCompat.HINT_SUPPORTS_DARK_TEXT) > 0 : false;
float[] hsl = new float[3];
ColorUtils.colorToHSL(mMainColor, hsl);
mIsDark = hsl[2] < 0.2f;
mIsDark = wallpaperColors != null
? (wallpaperColors.getColorHints()
& WallpaperColorsCompat.HINT_SUPPORTS_DARK_THEME) > 0 : false;
}
public void setOnThemeChangeListener(OnThemeChangeListener onThemeChangeListener) {