From c649ff6e2805eaf5a60a55e725719964b6cf55c3 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Sat, 24 Oct 2026 19:25:09 +0200 Subject: [PATCH] App 2.22.3: rename the Overview style Dashboard to Gauges The stored value becomes GAUGES; DASHBOARD still selects it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6 --- AGENTS.md | 2 +- SPECS.md | 4 ++ app/build.gradle | 4 +- .../java/com/evsuite/abrp/BatteryBarView.java | 2 +- .../main/java/com/evsuite/abrp/GaugeView.java | 2 +- app/src/main/java/com/evsuite/abrp/Gear.java | 2 +- .../java/com/evsuite/abrp/MainActivity.java | 41 ++++++++++--------- .../{pane_dashboard.xml => pane_gauges.xml} | 2 +- app/src/main/res/values/strings.xml | 2 +- 9 files changed, 33 insertions(+), 28 deletions(-) rename app/src/main/res/layout/{pane_dashboard.xml => pane_gauges.xml} (98%) diff --git a/AGENTS.md b/AGENTS.md index 64085f7..786414c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,7 +69,7 @@ Repository: `ssh://git@git.stinnesbeck.com:2222/nils/mg4.git` (remote `origin`), | Tab | Contents | |---|---| -| Overview | value tiles (battery, range, range/usage/energy since start, 5-min averages of range, usage, power, speed), vehicle info (odometer, lease allowance and the odometer against it), tyre pressures; read every 0.5 s on a background thread. Three styles (Settings → Overview style): Tiles, Dashboard (`GaugeView` needles), Cockpit (`RingView` rings, `TraceView` power trace) | +| Overview | value tiles (battery, range, range/usage/energy since start, 5-min averages of range, usage, power, speed), vehicle info (odometer, lease allowance and the odometer against it), tyre pressures; read every 0.5 s on a background thread. Three styles (Settings → Overview style): Tiles, Gauges (`GaugeView` needles), Cockpit (`RingView` rings, `TraceView` power trace) | | Consumption / Charging | period totals, daily log, charging sessions and curve | | Live data | on/off, ABRP API key and user token, upload frequency | | Server | URL, pairing by QR, ingest token, installation ID (read-only), config import | diff --git a/SPECS.md b/SPECS.md index a3a008f..16f3a51 100644 --- a/SPECS.md +++ b/SPECS.md @@ -131,6 +131,10 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does * confirmed car facts, app structure, UI conventions, build/test/ship, documents. It replaces upstream's EVABRPUploader text. The test emulator is now in the flake: `nix run .#car-emulator` (Android 9 AOSP at 1920×720, 160 dpi; the car build installs as the system user — checked). +- 2026-10-24 — App 2.22.3: the Overview style "Dashboard" is now called "Gauges" (stored as + `GAUGES`; the old value `DASHBOARD` still selects it, so the choice survives the update; + `pane_dashboard.xml` is `pane_gauges.xml`). The branches `dashboard-gauges` and + `dashboard-cockpit`, merged into main, are deleted. Tests and lint. - 2026-10-24 — App 2.22.2 (branch `dashboard-cockpit`): the gear badge names all four gears. The owner shifted through the lever with 2.22.1 and read the codes off the Logs tab: 1 P, 2 R, 3 N, 4 D (firmware SWI68-29958-1300R69). `Gear.label` maps them (unit-tested); any diff --git a/app/build.gradle b/app/build.gradle index 95635f8..b95ac77 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { applicationId "com.stinnesbeck.nilsmg4" minSdk 27 targetSdk 36 - versionCode 113 - versionName "2.22.2" + versionCode 114 + versionName "2.22.3" // Nothing about the server ships in the APK: its URL and ingest token are entered in // the app's Server tab (ServerConfig), and the database is only reachable by the server. diff --git a/app/src/main/java/com/evsuite/abrp/BatteryBarView.java b/app/src/main/java/com/evsuite/abrp/BatteryBarView.java index fe088da..b9fc75d 100644 --- a/app/src/main/java/com/evsuite/abrp/BatteryBarView.java +++ b/app/src/main/java/com/evsuite/abrp/BatteryBarView.java @@ -8,7 +8,7 @@ import android.util.AttributeSet; import android.view.View; /** - * The dashboard strip's battery: an outline with a terminal and vertical cells filled to the + * The Gauges strip's battery: an outline with a terminal and vertical cells filled to the * state of charge, in the accent colour. Null draws the empty outline, never an empty battery. */ public final class BatteryBarView extends View { diff --git a/app/src/main/java/com/evsuite/abrp/GaugeView.java b/app/src/main/java/com/evsuite/abrp/GaugeView.java index c1401b3..2322519 100644 --- a/app/src/main/java/com/evsuite/abrp/GaugeView.java +++ b/app/src/main/java/com/evsuite/abrp/GaugeView.java @@ -10,7 +10,7 @@ import android.view.View; import java.util.Locale; /** - * A round instrument for the dashboard Overview: a 240° scale open at the bottom, major and minor + * A round instrument for the Gauges Overview: a 240° scale open at the bottom, major and minor * ticks, numbers, a needle, and up to three lines of text in the middle — the unit, the value as * digits, and a caption. * diff --git a/app/src/main/java/com/evsuite/abrp/Gear.java b/app/src/main/java/com/evsuite/abrp/Gear.java index 120783a..93cc593 100644 --- a/app/src/main/java/com/evsuite/abrp/Gear.java +++ b/app/src/main/java/com/evsuite/abrp/Gear.java @@ -1,7 +1,7 @@ package com.evsuite.abrp; /** - * The gear letter for the dashboards, from the car's raw gear code: 1 P, 2 R, 3 N, 4 D, read + * The gear letter for the Overview styles, from the car's raw gear code: 1 P, 2 R, 3 N, 4 D, read * on the owner's car (firmware SWI68-29958-1300R69) by shifting through the lever. Any other * code shows no letter rather than a guess; unread is "—". */ diff --git a/app/src/main/java/com/evsuite/abrp/MainActivity.java b/app/src/main/java/com/evsuite/abrp/MainActivity.java index 4239d5f..f6b2ceb 100644 --- a/app/src/main/java/com/evsuite/abrp/MainActivity.java +++ b/app/src/main/java/com/evsuite/abrp/MainActivity.java @@ -66,7 +66,7 @@ public class MainActivity extends AppCompatActivity { private View serverPane; private View logPane; private View vehiclePane; - private View dashboardPane; + private View gaugesPane; private View cockpitPane; private View consumptionPane; private View chargingPane; @@ -244,7 +244,7 @@ public class MainActivity extends AppCompatActivity { servicePane = inflatePane(R.layout.pane_service); serverPane = inflatePane(R.layout.pane_server); vehiclePane = inflatePane(R.layout.pane_vehicle); - dashboardPane = inflatePane(R.layout.pane_dashboard); + gaugesPane = inflatePane(R.layout.pane_gauges); cockpitPane = inflatePane(R.layout.pane_cockpit); // The Overview page holds both styles; Settings → Overview style picks the one shown. android.widget.FrameLayout overviewPage = new android.widget.FrameLayout(this); @@ -252,7 +252,7 @@ public class MainActivity extends AppCompatActivity { android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT)); overviewPage.addView(vehiclePane); - overviewPage.addView(dashboardPane); + overviewPage.addView(gaugesPane); overviewPage.addView(cockpitPane); consumptionPane = inflatePane(R.layout.pane_consumption); chargingPane = inflatePane(R.layout.pane_charging); @@ -263,7 +263,7 @@ public class MainActivity extends AppCompatActivity { UpdateLog.noteVersion(this, BuildConfig.VERSION_NAME); bindVehiclePane(); - bindDashboard(); + bindGauges(); bindCockpit(); bindConsumptionPane(); bindChargingPane(); @@ -1424,7 +1424,7 @@ public class MainActivity extends AppCompatActivity { } } - // ---------- Dashboard (Overview style) ---------- + // ---------- Gauges (Overview style) ---------- static final String PREF_OVERVIEW_STYLE = "overview_style"; private GaugeView dashPower, dashSpeed, dashBattery; @@ -1434,11 +1434,12 @@ public class MainActivity extends AppCompatActivity { private Double dashTripKm; /** The stored values of the Overview styles, in the order of the drop-down. */ - private static final String[] OVERVIEW_STYLES = { "TILES", "DASHBOARD", "COCKPIT" }; + private static final String[] OVERVIEW_STYLES = { "TILES", "GAUGES", "COCKPIT" }; /** The chosen style's index in {@link #OVERVIEW_STYLES}; anything unknown is Tiles. */ private int overviewStyle() { String style = prefs.getString(PREF_OVERVIEW_STYLE, "TILES"); + if ("DASHBOARD".equals(style)) style = "GAUGES"; // its name before 2.22.3 for (int i = 0; i < OVERVIEW_STYLES.length; i++) if (OVERVIEW_STYLES[i].equals(style)) return i; return 0; } @@ -1446,13 +1447,13 @@ public class MainActivity extends AppCompatActivity { private void applyOverviewStyle() { int style = overviewStyle(); vehiclePane.setVisibility(style == 0 ? View.VISIBLE : View.GONE); - dashboardPane.setVisibility(style == 1 ? View.VISIBLE : View.GONE); + gaugesPane.setVisibility(style == 1 ? View.VISIBLE : View.GONE); cockpitPane.setVisibility(style == 2 ? View.VISIBLE : View.GONE); } - /** Tiles (the cards), Dashboard (gauges) or Cockpit (rings); all are fed on every reading. */ + /** Tiles (the cards), Gauges (needles) or Cockpit (rings); all are fed on every reading. */ private void bindOverviewStyle() { - String[] labels = { getString(R.string.overview_style_tiles), getString(R.string.overview_style_dashboard), + String[] labels = { getString(R.string.overview_style_tiles), getString(R.string.overview_style_gauges), getString(R.string.overview_style_cockpit) }; bindChoices(settingsPane.findViewById(R.id.overview_style_choices), labels, overviewStyle(), position -> { @@ -1461,15 +1462,15 @@ public class MainActivity extends AppCompatActivity { }); } - private void bindDashboard() { - dashPower = dashboardPane.findViewById(R.id.dash_power); - dashSpeed = dashboardPane.findViewById(R.id.dash_speed); - dashBattery = dashboardPane.findViewById(R.id.dash_battery); - dashBatteryBar = dashboardPane.findViewById(R.id.dash_battery_bar); - dashGear = dashboardPane.findViewById(R.id.dash_gear); - dashClimate = dashboardPane.findViewById(R.id.dash_climate); - dashUsage = dashboardPane.findViewById(R.id.dash_usage); - dashBatteryText = dashboardPane.findViewById(R.id.dash_battery_text); + private void bindGauges() { + dashPower = gaugesPane.findViewById(R.id.dash_power); + dashSpeed = gaugesPane.findViewById(R.id.dash_speed); + dashBattery = gaugesPane.findViewById(R.id.dash_battery); + dashBatteryBar = gaugesPane.findViewById(R.id.dash_battery_bar); + dashGear = gaugesPane.findViewById(R.id.dash_gear); + dashClimate = gaugesPane.findViewById(R.id.dash_climate); + dashUsage = gaugesPane.findViewById(R.id.dash_usage); + dashBatteryText = gaugesPane.findViewById(R.id.dash_battery_text); dashPower.configure(-50f, 150f, 50f, 5, getString(R.string.dash_unit_kw)); dashSpeed.configure(0f, 180f, 20f, 4, getString(R.string.dash_unit_kmh)); dashBattery.configure(0f, 100f, 25f, 5, getString(R.string.dash_unit_battery)); @@ -1538,7 +1539,7 @@ public class MainActivity extends AppCompatActivity { } /** The gauges and the strip; every value null-safe ("—", no needle). */ - private void showDashboard(EnergySnapshot s) { + private void showGauges(EnergySnapshot s) { if (dashPower == null) return; Float power = s.getBatteryPowerKw(); dashPower.setValue(power, power == null ? null : String.format(java.util.Locale.US, "%.1f", power), null); @@ -1575,7 +1576,7 @@ public class MainActivity extends AppCompatActivity { vehTireFr.setText(unit.format(s.getTirePressures().getFrontRightKpa())); vehTireRl.setText(unit.format(s.getTirePressures().getRearLeftKpa())); vehTireRr.setText(unit.format(s.getTirePressures().getRearRightKpa())); - showDashboard(s); + showGauges(s); showCockpit(s); } catch (Throwable ignored) { // Leave the last good reading on screen. diff --git a/app/src/main/res/layout/pane_dashboard.xml b/app/src/main/res/layout/pane_gauges.xml similarity index 98% rename from app/src/main/res/layout/pane_dashboard.xml rename to app/src/main/res/layout/pane_gauges.xml index 5e97a21..4b2f6c7 100644 --- a/app/src/main/res/layout/pane_dashboard.xml +++ b/app/src/main/res/layout/pane_gauges.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 07b3c08..0ea84a3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -121,7 +121,7 @@ Hides the car\'s top and bottom bars while this app is open. Swipe in from the top or bottom edge to show them briefly, e.g. for the climate controls. Overview style Tiles - Dashboard + Gauges kW km/h SOC