From 194f01eed7f2e7e20a292e1846265b5622ccf0d5 Mon Sep 17 00:00:00 2001 From: Nico Wiedemann Date: Sat, 12 Sep 2026 02:44:48 +0200 Subject: [PATCH 1/2] fix(car): show only one image on the car screen Google Play rejected version code 11 under the Android for Cars "images on screen" guideline, which permits a single static image for content context. The graph occupies that slot, so the trend arrow beside the reading was a second image on the same screen, and the graph's value bubbles made it read as a data display rather than content context. The graph bitmap is now held for five minutes regardless of how fast the source reports, so the one permitted image is static rather than a live view. Sources uploading faster than sensor cadence previously redrew it on every poll. The reading, delta and timestamps beside it are text and still update as soon as data arrives. The arrow and the value bubbles are switched off behind flags rather than deleted, so they can be restored if the guideline or its reading changes. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 9 ++++ .../de/autosugar/car/GlucoseGraphRenderer.kt | 22 ++++++-- .../java/de/autosugar/car/GlucoseScreen.kt | 54 +++++++++++++++---- 3 files changed, 70 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0155c52..a50343b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Removed + +- The trend arrow image beside the reading is gone. The Android for Cars guidelines permit a single static image for content context on the car screen, and the arrow was a second image alongside the graph — Google Play rejected version code 11 on that basis. The graph is now the only image on the screen at any time, and it sits in the background image slot the guideline designates for exactly that purpose. Which way the glucose is going still reads from the delta beside the reading and from the graph itself + +### Changed + +- The graph no longer labels individual readings with value bubbles, so it shows the shape of the last three hours rather than a row of numbers to read while driving. The reading, the delta, the trend line and its colours, the target range band and the time and value axes are all unchanged +- The graph is now held as one fixed image for five minutes at a time and is never animated or continuously updated, in the way album art stays put for the length of a track. It used to be redrawn whenever new readings arrived, which for sources that upload faster than sensor cadence could mean once a minute. The reading, the delta and the timestamps beside the graph are text and still update as soon as new data arrives, so nothing about how quickly a new value reaches the screen has changed + ## [1.2.8] - 2026-09-08 ### Removed diff --git a/app/src/main/java/de/autosugar/car/GlucoseGraphRenderer.kt b/app/src/main/java/de/autosugar/car/GlucoseGraphRenderer.kt index 696cc63..8046b56 100644 --- a/app/src/main/java/de/autosugar/car/GlucoseGraphRenderer.kt +++ b/app/src/main/java/de/autosugar/car/GlucoseGraphRenderer.kt @@ -16,6 +16,18 @@ import de.autosugar.data.model.MG_DL_PER_MMOL_L import java.util.Locale import kotlin.math.roundToInt +/** + * Whether the value bubbles along the trace are drawn. + * + * Off since Google Play rejected version code 11 under the Android for Cars "images on + * screen" guideline, which permits only a single static image for content context. The + * numeric bubbles are the part of the graph that reads as a data display rather than + * content context, and they are also the most to parse at a glance while driving. The + * drawing code below is deliberately kept so they can be switched back on if the guideline + * or its reading changes — flip this to `true`. + */ +private const val DROP_PINS_ENABLED = false + /** * Renders the 3-hour glucose history graph as a [CarIcon] bitmap. * @@ -212,10 +224,12 @@ private fun drawDropPinsAndHourLines( ) } - val closest = entries.minByOrNull { kotlin.math.abs(it.dateMs - t) } - if (closest != null) { - drawDropPin(canvas, closest, unit, x, dropFill, dropText, dropBodyW, dropBodyH, - dropCorner, dropTailW, dropTailH, minTipY, yOf, colorOf) + if (DROP_PINS_ENABLED) { + val closest = entries.minByOrNull { kotlin.math.abs(it.dateMs - t) } + if (closest != null) { + drawDropPin(canvas, closest, unit, x, dropFill, dropText, dropBodyW, dropBodyH, + dropCorner, dropTailW, dropTailH, minTipY, yOf, colorOf) + } } t += ms20 diff --git a/app/src/main/java/de/autosugar/car/GlucoseScreen.kt b/app/src/main/java/de/autosugar/car/GlucoseScreen.kt index f46562f..2193df0 100644 --- a/app/src/main/java/de/autosugar/car/GlucoseScreen.kt +++ b/app/src/main/java/de/autosugar/car/GlucoseScreen.kt @@ -34,6 +34,29 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.isActive import kotlinx.coroutines.launch +/** + * Whether the trend arrow is drawn next to the reading. + * + * Off since Google Play rejected version code 11 under the Android for Cars "images on + * screen" guideline, which permits only a single static image for content context. The + * graph occupies that one slot, so the arrow was a second image on the same screen. The + * arrow itself and [trendArrowIcon] are deliberately kept so it can be switched back on if + * the guideline or its reading changes — flip this to `true`. + */ +private const val TREND_ARROW_ENABLED = false + +/** + * Shortest interval at which the graph image may be redrawn. + * + * The graph is the one image the Android for Cars guidelines allow on the car screen, and + * they allow it as a *static* image for content context. Holding the bitmap for five + * minutes keeps that true no matter how fast the source reports: readings normally arrive + * at sensor cadence, but some uploaders push every minute, which would otherwise redraw the + * image on every poll and turn it into a live view. The reading, delta and timestamps + * beside it are text and keep updating as soon as data arrives. + */ +private const val MIN_GRAPH_REDRAW_MS = 5 * 60_000L + class GlucoseScreen( carContext: CarContext, private val repository: NightscoutRepository, @@ -68,6 +91,7 @@ class GlucoseScreen( ) private var cachedGraphKey: GraphCacheKey? = null private var cachedGraphIcon: CarIcon? = null + private var lastGraphRenderMs = 0L // onGetTemplate can fire frequently; cache the small generated bitmaps so they are // not re-rendered on the main thread on every rebuild. @@ -292,17 +316,17 @@ class GlucoseScreen( } else if (lastFetchedMs > 0) { statsRow.addText(carContext.getString(R.string.label_received, ageString(now - lastFetchedMs))) } - val pane = Pane.Builder() - .addRow( - Row.Builder() - .setTitle("${e.displayValue(unit)} ${unitLabel(unit)}") - .setImage( - trendIconCache.getOrPut(e.direction) { trendArrowIcon(e.direction) }, - Row.IMAGE_TYPE_LARGE, - ) - .addText("${e.displayDelta(unit) ?: "-"} ${unitLabel(unit)}") - .build() + val valueRow = Row.Builder() + .setTitle("${e.displayValue(unit)} ${unitLabel(unit)}") + .addText("${e.displayDelta(unit) ?: "-"} ${unitLabel(unit)}") + if (TREND_ARROW_ENABLED) { + valueRow.setImage( + trendIconCache.getOrPut(e.direction) { trendArrowIcon(e.direction) }, + Row.IMAGE_TYPE_LARGE, ) + } + val pane = Pane.Builder() + .addRow(valueRow.build()) .addRow(statsRow.build()) if (errorMessage != null) { pane.addAction( @@ -322,11 +346,18 @@ class GlucoseScreen( bgLow = thresholds.bgLow, bgHigh = thresholds.bgHigh, ) - if (cachedGraphKey != key) { + // Draw immediately when there is nothing on screen yet (first reading, or a + // profile switch); otherwise hold the current image for MIN_GRAPH_REDRAW_MS even + // if newer readings have arrived. The stale key is kept, not overwritten, so the + // next rebuild after the hold expires picks the newer data up. + if (cachedGraphIcon == null || + (cachedGraphKey != key && now - lastGraphRenderMs >= MIN_GRAPH_REDRAW_MS) + ) { cachedGraphIcon = glucoseGraphIcon( history, unit, key.bgTargetBottom, key.bgTargetTop, key.bgLow, key.bgHigh, ) cachedGraphKey = key + lastGraphRenderMs = now } pane.setImage(cachedGraphIcon!!) } @@ -363,6 +394,7 @@ class GlucoseScreen( isLoading = true cachedGraphKey = null cachedGraphIcon = null + lastGraphRenderMs = 0L invalidate() lifecycleScope.launch { fetch() } } From a54483b2ec2f8228df4f03be35bb47c2190003be Mon Sep 17 00:00:00 2001 From: Nico Wiedemann Date: Sat, 12 Sep 2026 02:53:49 +0200 Subject: [PATCH 2/2] chore(release): bump version to 1.2.9 --- CHANGELOG.md | 2 ++ app/build.gradle.kts | 4 ++-- docs/whatsnew/1.2.9-ar | 1 + docs/whatsnew/1.2.9-de-DE | 1 + docs/whatsnew/1.2.9-en-US | 1 + docs/whatsnew/1.2.9-es-ES | 1 + docs/whatsnew/1.2.9-fr-FR | 1 + docs/whatsnew/1.2.9-hi-IN | 1 + docs/whatsnew/1.2.9-it-IT | 1 + docs/whatsnew/1.2.9-ja-JP | 1 + docs/whatsnew/1.2.9-nl-NL | 1 + docs/whatsnew/1.2.9-pt-PT | 1 + docs/whatsnew/1.2.9-zh-CN | 1 + 13 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 docs/whatsnew/1.2.9-ar create mode 100644 docs/whatsnew/1.2.9-de-DE create mode 100644 docs/whatsnew/1.2.9-en-US create mode 100644 docs/whatsnew/1.2.9-es-ES create mode 100644 docs/whatsnew/1.2.9-fr-FR create mode 100644 docs/whatsnew/1.2.9-hi-IN create mode 100644 docs/whatsnew/1.2.9-it-IT create mode 100644 docs/whatsnew/1.2.9-ja-JP create mode 100644 docs/whatsnew/1.2.9-nl-NL create mode 100644 docs/whatsnew/1.2.9-pt-PT create mode 100644 docs/whatsnew/1.2.9-zh-CN diff --git a/CHANGELOG.md b/CHANGELOG.md index a50343b..fd07da8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +## [1.2.9] - 2026-09-12 + ### Removed - The trend arrow image beside the reading is gone. The Android for Cars guidelines permit a single static image for content context on the car screen, and the arrow was a second image alongside the graph — Google Play rejected version code 11 on that basis. The graph is now the only image on the screen at any time, and it sits in the background image slot the guideline designates for exactly that purpose. Which way the glucose is going still reads from the delta beside the reading and from the graph itself diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b7ae2d3..cc9cfcf 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,8 +14,8 @@ android { applicationId = "de.autosugar" minSdk = 26 targetSdk = 37 - versionCode = 13 - versionName = "1.2.8" + versionCode = 14 + versionName = "1.2.9" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/docs/whatsnew/1.2.9-ar b/docs/whatsnew/1.2.9-ar new file mode 100644 index 0000000..a2bf472 --- /dev/null +++ b/docs/whatsnew/1.2.9-ar @@ -0,0 +1 @@ +تعرض شاشة السيارة الآن صورة ثابتة واحدة فقط، وفق إرشادات Android Auto. أُزيل سهم الاتجاه بجانب القراءة، ولم يعد الرسم البياني يضع قيمة لكل قراءة. يبقى الرسم البياني ثابتًا خمس دقائق، بينما تستمر القراءة والفارق والأوقات في التحديث فورًا. diff --git a/docs/whatsnew/1.2.9-de-DE b/docs/whatsnew/1.2.9-de-DE new file mode 100644 index 0000000..e0a86b2 --- /dev/null +++ b/docs/whatsnew/1.2.9-de-DE @@ -0,0 +1 @@ +Der Autobildschirm zeigt jetzt nur noch ein einziges, statisches Bild, wie es die Android-Auto-Richtlinien verlangen. Der Trendpfeil neben dem Wert entfällt, und die Grafik beschriftet einzelne Messwerte nicht mehr. Die Grafik bleibt jeweils fünf Minuten stehen; Wert, Änderung und Zeiten aktualisieren sich weiterhin sofort. diff --git a/docs/whatsnew/1.2.9-en-US b/docs/whatsnew/1.2.9-en-US new file mode 100644 index 0000000..e4e2845 --- /dev/null +++ b/docs/whatsnew/1.2.9-en-US @@ -0,0 +1 @@ +The car screen now shows a single, static image, as the Android Auto guidelines require. The trend arrow beside the reading is gone, and the graph no longer labels each reading with a value. The graph now holds for five minutes at a time; the reading, change and times still update right away. diff --git a/docs/whatsnew/1.2.9-es-ES b/docs/whatsnew/1.2.9-es-ES new file mode 100644 index 0000000..5992928 --- /dev/null +++ b/docs/whatsnew/1.2.9-es-ES @@ -0,0 +1 @@ +La pantalla del coche ahora muestra una sola imagen estática, como exigen las normas de Android Auto. Desaparece la flecha de tendencia junto al valor y el gráfico ya no etiqueta cada lectura. El gráfico se mantiene fijo cinco minutos; el valor, la variación y las horas se siguen actualizando al instante. diff --git a/docs/whatsnew/1.2.9-fr-FR b/docs/whatsnew/1.2.9-fr-FR new file mode 100644 index 0000000..abaf3b4 --- /dev/null +++ b/docs/whatsnew/1.2.9-fr-FR @@ -0,0 +1 @@ +L'écran de la voiture n'affiche plus qu'une seule image statique, comme l'exigent les règles d'Android Auto. La flèche de tendance à côté de la valeur disparaît et le graphique n'étiquette plus chaque mesure. Le graphique reste fixe pendant cinq minutes ; la valeur, l'écart et les horaires se mettent toujours à jour immédiatement. diff --git a/docs/whatsnew/1.2.9-hi-IN b/docs/whatsnew/1.2.9-hi-IN new file mode 100644 index 0000000..2fa6512 --- /dev/null +++ b/docs/whatsnew/1.2.9-hi-IN @@ -0,0 +1 @@ +कार स्क्रीन अब केवल एक स्थिर छवि दिखाती है, जैसा Android Auto के दिशानिर्देश कहते हैं। रीडिंग के बगल का ट्रेंड तीर हटा दिया गया है और ग्राफ़ अब हर रीडिंग पर मान नहीं दिखाता। ग्राफ़ पाँच मिनट तक स्थिर रहता है; रीडिंग, बदलाव और समय पहले की तरह तुरंत अपडेट होते हैं। diff --git a/docs/whatsnew/1.2.9-it-IT b/docs/whatsnew/1.2.9-it-IT new file mode 100644 index 0000000..13b7d69 --- /dev/null +++ b/docs/whatsnew/1.2.9-it-IT @@ -0,0 +1 @@ +La schermata dell'auto ora mostra una sola immagine statica, come richiedono le linee guida di Android Auto. La freccia di tendenza accanto al valore non c'è più e il grafico non etichetta più ogni lettura. Il grafico resta fermo per cinque minuti; valore, variazione e orari si aggiornano sempre subito. diff --git a/docs/whatsnew/1.2.9-ja-JP b/docs/whatsnew/1.2.9-ja-JP new file mode 100644 index 0000000..04fe0b9 --- /dev/null +++ b/docs/whatsnew/1.2.9-ja-JP @@ -0,0 +1 @@ +Android Auto のガイドラインに合わせ、車の画面に表示される画像は静止画1点のみになりました。数値の横のトレンド矢印は廃止し、グラフも各測定値のラベル表示をやめました。グラフは5分ごとの更新になりますが、数値・変化量・時刻はこれまでどおりすぐに更新されます。 diff --git a/docs/whatsnew/1.2.9-nl-NL b/docs/whatsnew/1.2.9-nl-NL new file mode 100644 index 0000000..25845d2 --- /dev/null +++ b/docs/whatsnew/1.2.9-nl-NL @@ -0,0 +1 @@ +Het autoscherm toont nu nog maar één statische afbeelding, zoals de richtlijnen van Android Auto vereisen. De trendpijl naast de waarde is weg en de grafiek labelt niet langer elke meting. De grafiek blijft vijf minuten staan; waarde, verschil en tijden worden nog steeds direct bijgewerkt. diff --git a/docs/whatsnew/1.2.9-pt-PT b/docs/whatsnew/1.2.9-pt-PT new file mode 100644 index 0000000..4e4cd5b --- /dev/null +++ b/docs/whatsnew/1.2.9-pt-PT @@ -0,0 +1 @@ +O ecrã do carro mostra agora apenas uma imagem estática, como exigem as regras do Android Auto. A seta de tendência ao lado do valor desapareceu e o gráfico já não identifica cada leitura. O gráfico mantém-se fixo durante cinco minutos; o valor, a variação e as horas continuam a atualizar de imediato. diff --git a/docs/whatsnew/1.2.9-zh-CN b/docs/whatsnew/1.2.9-zh-CN new file mode 100644 index 0000000..8ab1ffe --- /dev/null +++ b/docs/whatsnew/1.2.9-zh-CN @@ -0,0 +1 @@ +为符合 Android Auto 指南,车机屏幕现在只显示一张静态图片。读数旁的趋势箭头已移除,图表也不再标注每个读数的数值。图表每五分钟才更新一次;读数、变化量和时间仍会立即更新。