Merge changes from topic "variants_landing" into tm-dev am: ee74679e85
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17943620 Change-Id: I45e97a4655fa984a3d49e5f73ccbab80109b0b30 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -225,8 +225,13 @@ class ColorScheme(
|
|||||||
constructor(@ColorInt seed: Int, darkTheme: Boolean):
|
constructor(@ColorInt seed: Int, darkTheme: Boolean):
|
||||||
this(seed, darkTheme, Style.TONAL_SPOT)
|
this(seed, darkTheme, Style.TONAL_SPOT)
|
||||||
|
|
||||||
constructor(wallpaperColors: WallpaperColors, darkTheme: Boolean):
|
@JvmOverloads
|
||||||
this(getSeedColor(wallpaperColors), darkTheme)
|
constructor(
|
||||||
|
wallpaperColors: WallpaperColors,
|
||||||
|
darkTheme: Boolean,
|
||||||
|
style: Style = Style.TONAL_SPOT
|
||||||
|
):
|
||||||
|
this(getSeedColor(wallpaperColors), darkTheme, style)
|
||||||
|
|
||||||
val allAccentColors: List<Int>
|
val allAccentColors: List<Int>
|
||||||
get() {
|
get() {
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ public class ColorSchemeTest extends SysuiTestCase {
|
|||||||
Assert.assertEquals(rankedSeedColors, List.of(0xffaec00a));
|
Assert.assertEquals(rankedSeedColors, List.of(0xffaec00a));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStyleApplied() {
|
||||||
|
WallpaperColors wallpaperColors = new WallpaperColors(Color.valueOf(0xffaec00a),
|
||||||
|
null, null);
|
||||||
|
// Expressive applies hue rotations to the theme color. The input theme color has hue
|
||||||
|
// 117, ensuring the hue changed significantly is a strong signal styles are being applied.
|
||||||
|
ColorScheme colorScheme = new ColorScheme(wallpaperColors, false, Style.EXPRESSIVE);
|
||||||
|
Assert.assertEquals(Cam.fromInt(colorScheme.getAccent1().get(6)).getHue(), 357.46, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFiltersInvalidColors() {
|
public void testFiltersInvalidColors() {
|
||||||
|
|||||||
Reference in New Issue
Block a user