Skip to content

Ongoing notification v2: expandable Now / Average breakdown (follow-up to #192) #194

Description

@almothafar

Follow-up to #192, which made the ongoing notification's title the stable headline (85% · Discharging) and the content line the volatile details. This is the agreed v2 shape (mockup-approved): make it expandable, and add a labelled Now / Average breakdown when pulled down.

Collapsed (the glance)

  • Title (unchanged from Ongoing notification: stable metrics in the title, volatile details in the body #192): 85% · Discharging / 85% · Charging — stable metrics only.
  • Content: 9%/h · −250 mA · ~9h 27m remaining while discharging, ~18 W · +1500 mA · ~45m to full while charging.
    • Adds the instantaneous current (mA) next to the rate (AccuBattery-style pairing).
    • Temperature moves to the expanded view to keep the collapsed line short.
    • Wording: "left" → "remaining" (matches the details table's "Time remaining").

Expanded (pull down)

Labelled lines, label — value:

Discharging

Now        −250 mA · 9%/h
Average    −338 mA · 5.9%/h
Remaining  ~9h 27m
Temp       34.6 °C

Charging

Now        +1500 mA · ~18 W
To full    ~45m
Temp       34.6 °C

Notes

  • Expandable = switch the ongoing notification from a single line to BigTextStyle (or a two-state layout). It's single-line today.
  • Data: everything here already exists — %/h, instant + average mA, charge wattage, time estimates, temperature. No new tracking. (The Screen-on / Screen-off split is the separate Screen-on vs screen-off drain breakdown (notification + details table) #193.)
  • New strings (EN + AR): Now, Average, Remaining, To full; rename the Ongoing notification: stable metrics in the title, volatile details in the body #192 %s left%s remaining.
  • Arabic / RTL: apply BidiFormatter (bidi isolation) to the collapsed detail line so the Latin values (−250 mA, %/h) don't reorder inside the RTL line — that was garbled without it. New labels: الآن / المتوسط / المتبقّي / الحرارة (drafted, pending maintainer review). The status word stays تستهلك.

Acceptance criteria

  • Ongoing notification expands to the Now / Average / Remaining / Temp breakdown; collapses to the one-line glance
  • Collapsed line shows rate · current · remaining (discharging) / watts · current · to-full (charging); temperature only in the expanded view
  • "remaining" wording throughout (no "left")
  • Arabic detail line is bidi-isolated and readable RTL; new labels in values-ar
  • No new device reads — reuses the snapshot + rate the tick already computed (One snapshot per broadcast: derive ChargeSpeed from the BatteryDO in hand instead of fresh hardware reads #157)
  • Robolectric coverage for the collapsed line and the expanded lines (discharging + charging), mirroring OngoingStatusLines

Related: #192 (v1), #193 (screen-on/off split, later), #108/#124/#173/#188.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions