App 2.35.0: the app takes on the Overview style's own colours
While the style shows its own palette (Sci-fi, Cartoon, Aviation, Nixie; Retro and Terminal with "Original"), the navigation, buttons and titles take it instead of the accent colour, e.g. turquoise for Retro (StylePalette, style_palettes.xml). Blueprint and Mascot are removed; a stored one opens Tiles. The navigation no longer saves view state, which crashed a restore across the wide and narrow layouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
package com.evsuite.abrp;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/** The Mascot style's moods — pure JVM. */
|
||||
public class MascotMoodTest {
|
||||
|
||||
private static ClusterValues values(Integer gear, Float speed, Float soc, Float power) {
|
||||
ClusterValues v = new ClusterValues();
|
||||
v.gear = gear;
|
||||
v.speedKmh = speed;
|
||||
v.socPercent = soc;
|
||||
v.powerKw = power;
|
||||
return v;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nothingReadIsWaiting() {
|
||||
assertEquals(MascotMood.WAITING, MascotMood.of(null));
|
||||
assertEquals(MascotMood.WAITING, MascotMood.of(new ClusterValues()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void moodsByPriority() {
|
||||
assertEquals(MascotMood.REVERSE, MascotMood.of(values(2, 3f, 10f, 5f)));
|
||||
assertEquals(MascotMood.WORRIED, MascotMood.of(values(4, 50f, 15f, 10f)));
|
||||
assertEquals(MascotMood.WORRIED, MascotMood.of(values(1, 0f, 15f, 0f)));
|
||||
assertEquals(MascotMood.SLEEPING, MascotMood.of(values(1, 0f, 80f, 0f)));
|
||||
assertEquals(MascotMood.CHEERING, MascotMood.of(values(4, 120f, 80f, -20f)));
|
||||
assertEquals(MascotMood.DETERMINED, MascotMood.of(values(4, 60f, 80f, 90f)));
|
||||
assertEquals(MascotMood.FAST, MascotMood.of(values(4, 110f, 80f, 25f)));
|
||||
assertEquals(MascotMood.CONTENT, MascotMood.of(values(4, 50f, 80f, 10f)));
|
||||
assertEquals(MascotMood.CONTENT, MascotMood.of(values(3, 0f, 80f, 0f)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unreadValuesAreNoReason() {
|
||||
// Speed unread, battery unread: in D she is content, not worried or fast.
|
||||
assertEquals(MascotMood.CONTENT, MascotMood.of(values(4, null, null, 10f)));
|
||||
assertEquals(MascotMood.CONTENT, MascotMood.of(values(null, 50f, null, null)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void holderWaitsOutShortChanges() {
|
||||
MascotMood.Holder holder = new MascotMood.Holder();
|
||||
assertEquals(MascotMood.CONTENT, holder.update(MascotMood.CONTENT, 0));
|
||||
assertEquals(MascotMood.CONTENT, holder.update(MascotMood.CHEERING, 100));
|
||||
assertEquals(MascotMood.CONTENT, holder.update(MascotMood.CONTENT, 300));
|
||||
assertEquals(MascotMood.CONTENT, holder.update(MascotMood.CHEERING, 400));
|
||||
assertEquals(MascotMood.CONTENT, holder.update(MascotMood.CHEERING, 1800));
|
||||
assertEquals(MascotMood.CHEERING, holder.update(MascotMood.CHEERING, 1900));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reverseAndWaitingShowAtOnce() {
|
||||
MascotMood.Holder holder = new MascotMood.Holder();
|
||||
holder.update(MascotMood.SLEEPING, 0);
|
||||
assertEquals(MascotMood.REVERSE, holder.update(MascotMood.REVERSE, 10));
|
||||
assertEquals(MascotMood.WAITING, holder.update(MascotMood.WAITING, 20));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void characterFromPref() {
|
||||
assertEquals(MascotCharacter.CHIBI, MascotCharacter.fromPref("CHIBI"));
|
||||
assertEquals(MascotCharacter.FOX, MascotCharacter.fromPref("FOX"));
|
||||
assertEquals(MascotCharacter.CLASSIC, MascotCharacter.fromPref("CLASSIC"));
|
||||
assertEquals(MascotCharacter.CLASSIC, MascotCharacter.fromPref(null));
|
||||
assertEquals(MascotCharacter.CLASSIC, MascotCharacter.fromPref("NOPE"));
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,31 @@ public class OverviewStyleTest {
|
||||
assertTrue(OverviewStyle.TERMINAL.hasOriginal);
|
||||
assertFalse(OverviewStyle.CARTOON.usesAccent);
|
||||
assertFalse(OverviewStyle.NIXIE.usesAccent);
|
||||
assertTrue(OverviewStyle.MASCOT.usesAccent);
|
||||
assertTrue(OverviewStyle.CHRONOGRAPH.usesAccent);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removedStylesFallBackToTiles() {
|
||||
assertEquals(OverviewStyle.TILES, OverviewStyle.fromPref("MASCOT"));
|
||||
assertEquals(OverviewStyle.TILES, OverviewStyle.fromPref("BLUEPRINT"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ownPaletteForTheApp() {
|
||||
// Fixed palettes always; Retro and Terminal only with "Original colours".
|
||||
assertTrue(OverviewStyle.CARTOON.showsOwnPalette(false));
|
||||
assertTrue(OverviewStyle.RETRO.showsOwnPalette(true));
|
||||
assertFalse(OverviewStyle.RETRO.showsOwnPalette(false));
|
||||
assertFalse(OverviewStyle.CHRONOGRAPH.showsOwnPalette(true));
|
||||
// Every style shown in its own palette has the app's matching colours.
|
||||
for (OverviewStyle style : OverviewStyle.values()) {
|
||||
if (style.showsOwnPalette(true)) assertTrue(style.name(), StylePalette.overlay(style) != 0);
|
||||
else assertEquals(style.name(), 0, StylePalette.overlay(style));
|
||||
}
|
||||
assertEquals(AccentColor.HOLBORN_BLUE.overlay,
|
||||
StylePalette.appOverlay(OverviewStyle.RETRO, false, AccentColor.HOLBORN_BLUE));
|
||||
assertEquals(R.style.ThemeOverlay_EV_Style_Retro,
|
||||
StylePalette.appOverlay(OverviewStyle.RETRO, true, AccentColor.HOLBORN_BLUE));
|
||||
assertEquals("original_colours_RETRO", OverviewStyle.RETRO.originalKey());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user