App 2.10.2: infinity as the range while recuperating

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 11:01:02 +02:00
co-authored by Claude Opus 5.5
parent 3ae1e18a43
commit 087f193f8c
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ android {
applicationId "com.stinnesbeck.nilsmg4"
minSdk 27
targetSdk 36
versionCode 71
versionName "2.10.1"
versionCode 72
versionName "2.10.2"
// 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.
@@ -1038,8 +1038,10 @@ public class MainActivity extends AppCompatActivity {
usageNote.setText(whyNot);
return;
}
// Coasting at speed costs almost nothing, which would read as thousands of km.
range.setText(e.rangeKm > 999 ? getString(R.string.range_over, 999)
// Recuperating, the pack gains energy: the range is unbounded. Coasting at speed costs
// almost nothing, which would read as thousands of km.
range.setText(e.kwhPer100Km <= 0 ? "∞"
: e.rangeKm > 999 ? getString(R.string.range_over, 999)
: String.format(java.util.Locale.US, "%.0f km", e.rangeKm));
rangeNote.setText(e.kwhPer100Km <= 0 ? getString(R.string.range_recuperating) : "");
usage.setText(getString(R.string.range_consumption, e.kwhPer100Km));