From e2922e48422149e6a9c54d43561a22dd678af799 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Fri, 23 Oct 2026 22:18:32 +0200 Subject: [PATCH] App 2.19.8: charging curve labels clear of each other; Charging tab 35/65 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6 --- SPECS.md | 5 +++ app/build.gradle | 4 +- .../com/evsuite/abrp/ChargingGraphView.java | 39 ++++++++++++++++--- .../main/res/layout-w1000dp/pane_charging.xml | 6 +-- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/SPECS.md b/SPECS.md index de5b5e6..6713462 100644 --- a/SPECS.md +++ b/SPECS.md @@ -118,6 +118,11 @@ 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-23 — App 2.19.8: the charging curve's labels no longer overlap: "kW" has a row of its + own above the plot, the power values are right-aligned against the axis, and the SOC ticks read + "0 %" … "100 %" (the separate "SOC %" sat on top of "100"). The wide Charging tab splits 35/65, + values | curve. Checked on the emulator with sample AC values and a curve in a throwaway build; + the page still fits 1778×640. - 2026-10-23 — App 2.19.7: AC charging is metered too, while the app runs (owner's choice; Fatih had metered DC only, `e9bfa12`, because an overnight AC charge is slept through). A session runs whenever power flows into the pack (`ChargingState.isMeteredCharging`: inbound > 0.3 kW and a diff --git a/app/build.gradle b/app/build.gradle index bc684e3..3e95a38 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { applicationId "com.stinnesbeck.nilsmg4" minSdk 27 targetSdk 36 - versionCode 106 - versionName "2.19.7" + versionCode 107 + versionName "2.19.8" // 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/ChargingGraphView.java b/app/src/main/java/com/evsuite/abrp/ChargingGraphView.java index a4c7ccc..3a5ec11 100644 --- a/app/src/main/java/com/evsuite/abrp/ChargingGraphView.java +++ b/app/src/main/java/com/evsuite/abrp/ChargingGraphView.java @@ -41,12 +41,39 @@ public final class ChargingGraphView extends View { } return found ? out.toString().trim() : "No charging measurements yet"; } + /** + * Axes with their labels clear of each other: "kW" in a row of its own above the plot, the + * power values right-aligned against the y axis, and the SOC ticks as "0 %" … "100 %", + * centred under their lines, the last one kept inside the view. + */ @Override protected synchronized void onDraw(Canvas c) { - super.onDraw(c); float left=58, right=getWidth()-12, top=12, bottom=getHeight()-38; - float max=20; for(float[] p:points) max=Math.max(max,p[1]); max=(float)Math.ceil(max/20f)*20f; - for(int i=0;i<=5;i++){float y=bottom-(bottom-top)*i/5f; c.drawLine(left,y,right,y,grid); c.drawText(String.format(Locale.US,"%.0f",max*i/5f),4,y+7,text);} - for(int soc=0;soc<=100;soc+=20){float x=left+(right-left)*soc/100f; c.drawLine(x,top,x,bottom,grid); c.drawText(String.valueOf(soc),x-10,getHeight()-8,text);} - c.drawText("kW",5,20,text); c.drawText("SOC %",right-52,getHeight()-8,text); - for(int i=1;i - + - + @@ -16,7 +16,7 @@ - +