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:
@@ -0,0 +1,31 @@
|
||||
package com.evsuite.abrp;
|
||||
|
||||
/**
|
||||
* The app's colours while an Overview style shows its own palette: the theme overlay
|
||||
* (res/values/style_palettes.xml) that MainActivity lays over the accent colour, so the
|
||||
* navigation and the rest of the app match the style — Retro's turquoise, Terminal's green
|
||||
* phosphor, and so on. Styles drawn in the accent colour have none.
|
||||
*/
|
||||
final class StylePalette {
|
||||
|
||||
private StylePalette() {}
|
||||
|
||||
/** The overlay for a style's own palette, or 0 for a style that has none. */
|
||||
static int overlay(OverviewStyle style) {
|
||||
switch (style) {
|
||||
case RETRO: return R.style.ThemeOverlay_EV_Style_Retro;
|
||||
case TERMINAL: return R.style.ThemeOverlay_EV_Style_Terminal;
|
||||
case SCIFI: return R.style.ThemeOverlay_EV_Style_SciFi;
|
||||
case CARTOON: return R.style.ThemeOverlay_EV_Style_Cartoon;
|
||||
case AVIATION: return R.style.ThemeOverlay_EV_Style_Aviation;
|
||||
case NIXIE: return R.style.ThemeOverlay_EV_Style_Nixie;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/** The overlay the app wears: the style's own when it shows its palette, else the accent's. */
|
||||
static int appOverlay(OverviewStyle style, boolean originalChosen, AccentColor accent) {
|
||||
int own = overlay(style);
|
||||
return own != 0 && style.showsOwnPalette(originalChosen) ? own : accent.overlay;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user