Expandable ongoing notification: Now / Average breakdown on pull-down (#194)#195
Merged
Merged
Conversation
…194) Follow-up to #192. The ongoing status notification becomes a BigTextStyle two-state notification: - Collapsed: the volatile numbers on one line — rate/power · current · time, e.g. "9%/h · −250 mA · ~9h 27m remaining" / "~18 W · +2000 mA · ~1h 0m to full". Temperature moves to the expanded view; "left" → "remaining". - Expanded: a labelled breakdown — Now (instant current, + wattage while charging), Average (windowed-average current, carrying the smoothed %/h while discharging), Time remaining / Time to full, and Temperature. Each line is dropped when its data is absent; expansion is only offered when the breakdown is genuinely multi-line. The app has a single smoothed rate (itself an average), so there is no separate instantaneous %/h — the %/h rides the Average line rather than being faked onto a "Now" line. RTL: the Latin values (mA, %/h, watts, durations) are wrapped with BidiFormatter so they don't reorder inside an Arabic line (the garbling seen before). No-op in LTR. New labels reuse the details table's strings (Time remaining / Time to full / Temperature / Drain rate); new: Now, Average, and the "label: value" line format. All EN + AR (Arabic drafted, pending review). Tests: OngoingStatusLines reworked to 10 — collapsed (discharge/charge/no-current), expanded (discharge/charge/drain-rate-fallback), the built notification's BigText, temperature-only-and-not-expandable when the toggle is off, and null-snapshot. Closes #194 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 19, 2026
…age") EN "Now" → "Live", AR "الآن" → "مباشر". Only the string values change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #192 (which made the title the stable headline and the content the volatile details). This turns the ongoing status notification into a BigTextStyle two-state notification — the mockup-approved v2 shape.
Collapsed (the glance)
85% · Discharging/85% · Charging.9%/h · −250 mA · ~9h 27m remaining~18 W · +2000 mA · ~1h 0m to fullExpanded (pull down)
Labelled
label: valuelines:Discharging —
Now: −250 mA/Average: −338 mA · 9%/h/Time remaining: ~9h 27m/Temperature: 34.6 °CCharging —
Now: +2000 mA · ~10 W/Average: +1900 mA/Time to full: ~1h 0m/Temperature: 34.6 °CNow= instantaneous current (+ wattage while charging);Average= the windowed-average current (from Current row flickers and disagrees between surfaces — show moment value with windowed average, gate visibility on the average #173).Averageline rather than being faked ontoNow. When the average current isn't ready yet, the %/h gets its ownDrain rate:line so it isn't lost.Temperature-only never shows a pointless expand chevron).Arabic / RTL
The Latin values (
−250 mA,%/h,~18 W, durations) are wrapped withBidiFormatterso they don't reorder inside an Arabic line — the garbling seen before. It's a no-op in LTR locales, so the LTR values are untouched (and the tests stay clean). New labels Now / Average + the%1$s: %2$sline format in EN + AR; the rest reuse the details table's existing strings (Time remaining / Time to full / Temperature / Drain rate). Arabic drafted — pending review.Data / scope
No new device reads — reuses the same snapshot + rate the tick already computed (#157). No new tracking (the Screen-on/off split stays as #193).
Testing
OngoingStatusLinesreworked to 10 tests: collapsed (discharge / charge / no-current-yet), expanded (discharge / charge / drain-rate fallback), the built notification'sEXTRA_BIG_TEXT, temperature-only-and-not-expandable when the toggle is off, and the null snapshot. Full:app:testDebugUnitTest(439) +lintDebuggreen; installed on the Mate 10 Pro.(Couldn't grab a live shot — the foreground-service notification isn't staying alive under EMUI's background killer — but the Robolectric tests assert the exact posted title and expanded text.)
Closes #194
Related: #192, #193, #173/#188.
🤖 Generated with Claude Code