App 2.12.1: no scroll bars; energy since start

The pages' scroll bars never faded on the car: a ScrollView shows its
bar on every layout, and the live values lay the page out every two
seconds. StableScrollView, the root of every page, now has none.

A new "Energy since start" tile, left of "Usage since start", shows the
net kWh taken from the pack since the trip began, recuperation counted
back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-18 13:12:12 +02:00
co-authored by Claude Opus 5.5
parent d711e0cfda
commit 66fed48aae
9 changed files with 56 additions and 6 deletions
@@ -115,4 +115,17 @@ public class RangeEstimatorTest {
assertEquals(-6.25, regen.kwhPer100Km, 0.01);
assertTrue(Double.isInfinite(regen.rangeKm));
}
@Test
public void energySinceStartIsTheNetEnergyOfTheTrip() {
RangeEstimator r = new RangeEstimator();
assertNull(r.energySinceStart());
r.add(0, 3f, 0f);
assertEquals(0.0, r.energySinceStart(), 1e-9); // the trip has begun
for (long t = 15_000; t <= 600_000; t += 15_000) r.add(t, 30f, 100f);
// 10 minutes at 30 kW = 5 kWh, plus the first 15 s ramp from 3 kW.
assertEquals(5.0, r.energySinceStart(), 0.1);
for (long t = 615_000; t <= 735_000; t += 15_000) r.add(t, -20f, 60f); // downhill
assertTrue(r.energySinceStart() < 5.0); // recuperation counts back
}
}