summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Bertschler <bmario@google.com>2017-07-10 10:27:21 -0700
committerMario Bertschler <bmario@google.com>2017-07-10 11:17:55 -0700
commite5f4939cba2e884c2ceec03886e84f7dba6c26ab (patch)
treea21e36bd769ce0e5146b4b11876a6e758115430e
parent6c5d10261eceaf1b57bce82e4e31d272bad2c349 (diff)
downloadandroid_packages_apps_Trebuchet-e5f4939cba2e884c2ceec03886e84f7dba6c26ab.tar.gz
android_packages_apps_Trebuchet-e5f4939cba2e884c2ceec03886e84f7dba6c26ab.tar.bz2
android_packages_apps_Trebuchet-e5f4939cba2e884c2ceec03886e84f7dba6c26ab.zip
Supporting dark theme hint for wallpaper colors.
Bug: 63143283 Change-Id: I0815d22215409d781348d74baace8cb5d1e15fb8
-rw-r--r--src/com/android/launcher3/compat/WallpaperColorsCompat.java1
-rw-r--r--src/com/android/launcher3/dynamicui/WallpaperColorInfo.java6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher3/compat/WallpaperColorsCompat.java b/src/com/android/launcher3/compat/WallpaperColorsCompat.java
index 58d2a8028..e25b9d929 100644
--- a/src/com/android/launcher3/compat/WallpaperColorsCompat.java
+++ b/src/com/android/launcher3/compat/WallpaperColorsCompat.java
@@ -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;
diff --git a/src/com/android/launcher3/dynamicui/WallpaperColorInfo.java b/src/com/android/launcher3/dynamicui/WallpaperColorInfo.java
index 512e89a41..80a89e37d 100644
--- a/src/com/android/launcher3/dynamicui/WallpaperColorInfo.java
+++ b/src/com/android/launcher3/dynamicui/WallpaperColorInfo.java
@@ -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) {