Supporting dark theme hint for wallpaper colors.
Bug: 63143283 Change-Id: I0815d22215409d781348d74baace8cb5d1e15fb8
This commit is contained in:
parent
6c5d10261e
commit
e5f4939cba
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue