App 2.26.0: Overview styles Minimal, Terminal, Aviation, Nixie, Chronograph
Five more styles that differ in arrangement as well as look: the speed alone with hairlines; a green text terminal with ASCII bars; a flight display with tapes and a horizon that pitches with power; nixie tubes on walnut and brass; a watch face with sub-dials. They share a new base, ClusterCanvasView. Emulator only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -66,6 +66,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
private CartoonView cartoonView;
|
||||
private BlueprintView blueprintView;
|
||||
private OctagonView octagonView;
|
||||
/** The styles built on {@link ClusterCanvasView}, fed together. */
|
||||
private final java.util.List<ClusterCanvasView> canvasStyles = new java.util.ArrayList<>();
|
||||
/** The pane of each Overview style, by its index in {@link #OVERVIEW_STYLES}. */
|
||||
private View[] stylePanes;
|
||||
private View consumptionPane;
|
||||
@@ -254,8 +256,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
octagonView = new OctagonView(this, null);
|
||||
View sciFiPane = drawnPane(sciFiView), cartoonPane = drawnPane(cartoonView),
|
||||
blueprintPane = drawnPane(blueprintView), mgPane = drawnPane(octagonView);
|
||||
java.util.Collections.addAll(canvasStyles, new MinimalView(this), new TerminalView(this),
|
||||
new AviationView(this), new NixieView(this), new ChronographView(this));
|
||||
View[] canvasPanes = new View[canvasStyles.size()];
|
||||
for (int i = 0; i < canvasPanes.length; i++) canvasPanes[i] = drawnPane(canvasStyles.get(i));
|
||||
stylePanes = new View[] { vehiclePane, gaugesPane, cockpitPane, retroPane, retroPane,
|
||||
futuristicPane, sciFiPane, cartoonPane, blueprintPane, mgPane };
|
||||
futuristicPane, sciFiPane, cartoonPane, blueprintPane, mgPane,
|
||||
canvasPanes[0], canvasPanes[1], canvasPanes[2], canvasPanes[3], canvasPanes[4] };
|
||||
// The Overview page holds every style; Settings → Overview style picks the one shown.
|
||||
android.widget.FrameLayout overviewPage = new android.widget.FrameLayout(this);
|
||||
overviewPage.setLayoutParams(new android.view.ViewGroup.LayoutParams(
|
||||
@@ -270,6 +277,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
overviewPage.addView(cartoonPane);
|
||||
overviewPage.addView(blueprintPane);
|
||||
overviewPage.addView(mgPane);
|
||||
for (View pane : canvasPanes) overviewPage.addView(pane);
|
||||
consumptionPane = inflatePane(R.layout.pane_consumption);
|
||||
chargingPane = inflatePane(R.layout.pane_charging);
|
||||
settingsPane = inflatePane(R.layout.pane_settings);
|
||||
@@ -1454,7 +1462,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
/** The stored values of the Overview styles, in the order of the drop-down. */
|
||||
private static final String[] OVERVIEW_STYLES = { "TILES", "GAUGES", "COCKPIT", "RETRO", "RETRO_ACCENT", "FUTURISTIC",
|
||||
"SCIFI", "CARTOON", "BLUEPRINT", "MG" };
|
||||
"SCIFI", "CARTOON", "BLUEPRINT", "MG", "MINIMAL", "TERMINAL", "AVIATION", "NIXIE", "CHRONOGRAPH" };
|
||||
|
||||
/** The chosen style's index in {@link #OVERVIEW_STYLES}; anything unknown is Tiles. */
|
||||
private int overviewStyle() {
|
||||
@@ -1477,7 +1485,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
getString(R.string.overview_style_cockpit), getString(R.string.overview_style_retro),
|
||||
getString(R.string.overview_style_retro_accent), getString(R.string.overview_style_futuristic),
|
||||
getString(R.string.overview_style_scifi), getString(R.string.overview_style_cartoon),
|
||||
getString(R.string.overview_style_blueprint), getString(R.string.overview_style_mg) };
|
||||
getString(R.string.overview_style_blueprint), getString(R.string.overview_style_mg),
|
||||
getString(R.string.overview_style_minimal), getString(R.string.overview_style_terminal),
|
||||
getString(R.string.overview_style_aviation), getString(R.string.overview_style_nixie),
|
||||
getString(R.string.overview_style_chronograph) };
|
||||
bindChoices(settingsPane.findViewById(R.id.overview_style_choices), labels, overviewStyle(),
|
||||
position -> {
|
||||
prefs.edit().putString(PREF_OVERVIEW_STYLE, OVERVIEW_STYLES[position]).apply();
|
||||
@@ -1540,6 +1551,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
cartoonView.setValues(v);
|
||||
blueprintView.setValues(v);
|
||||
octagonView.setValues(v);
|
||||
for (ClusterCanvasView view : canvasStyles) view.setValues(v);
|
||||
}
|
||||
|
||||
// ---------- Cockpit (Overview style) ----------
|
||||
|
||||
Reference in New Issue
Block a user