A tree with a bauble for the speed, fairy lights for the power, a mug of cocoa for the battery, a wreath clock and candy canes for the range. Its lights flare on the beat with the music light, now "Light follows the music" for Halloween and Christmas. A sleigh or an angel tows the song. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
40 lines
1.9 KiB
Java
40 lines
1.9 KiB
Java
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 NIXIE: return R.style.ThemeOverlay_EV_Style_Nixie;
|
|
case GRID:
|
|
case GRID_MAP: return R.style.ThemeOverlay_EV_Style_Grid;
|
|
case TIME_CIRCUITS: return R.style.ThemeOverlay_EV_Style_TimeCircuits;
|
|
case QUEST: return R.style.ThemeOverlay_EV_Style_Quest;
|
|
case VISOR: return R.style.ThemeOverlay_EV_Style_Visor;
|
|
case EMPIRE: return R.style.ThemeOverlay_EV_Style_Empire;
|
|
case MUERTOS: return R.style.ThemeOverlay_EV_Style_Muertos;
|
|
case HALLOWEEN: return R.style.ThemeOverlay_EV_Style_Halloween;
|
|
case CHRISTMAS: return R.style.ThemeOverlay_EV_Style_Christmas;
|
|
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;
|
|
}
|
|
}
|