Commit 5424533
committed
Dashboard: Consolidate battery and charging telemetry
Level and temperature were rendered on three surfaces through two
formatting paths, and the cards disagreed about what they were for. The
hero showed the policy but navigated to voltage and cycle counts. The
stats card opened two different destinations depending on its state and
carried a History button inside a body that was itself tappable. Its slot
moved with the charger, so the list reshuffled under the user. The
capture switch sat at the bottom of the session list.
Two cards with non-overlapping jobs, and one destination:
- The hero states the policy and nothing else. It is no longer clickable.
Its one reading line comes from BatteryEffect, derived from the battery
broadcast alone — never from the policy, because that title is often
only a last-requested claim and restating it would look like
corroboration. Wording stays neutral: NOT_CHARGING can be thermal or a
weak supply, and an unreported plug state claims nothing at all.
- The charging card is the single telemetry surface. It renders a live
reading in every state including capture-off, holds a fixed slot, and
always opens the hub. Its title follows the readout, saying "Charging"
only when the platform reports it.
- Battery details and the statistics screen merge into a "Battery &
charging" hub: capture switch, current-or-last charge, full readout,
and history in the top bar.
The hub's teaser is derived from the card's presentation rather than
`live ?: lastSession`, so a row left open by an unplug or a failed
service start cannot be shown as a charge in progress.
Both surfaces move to main/ui, where feature composition already lives,
keeping battery/ and stats/ one-way rather than mutually dependent.
The history flow now takes a provider invoked inside the flow.
ChargeStatsRepository resolves the database eagerly, so building it at
construction would have created stats.db for a user who never enabled
capture and only opened the hub.1 parent d9dfa1d commit 5424533
29 files changed
Lines changed: 2389 additions & 1256 deletions
File tree
- app/src
- debug/java/eu/darken/amply/screenshots
- main
- java/eu/darken/amply
- battery/ui
- common/compose
- main/ui
- battery
- dashboard
- settings
- stats/ui
- res/values
- test/java/eu/darken/amply
- main/ui
- battery
- dashboard
- stats/ui
Lines changed: 58 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
132 | 177 | | |
133 | 178 | | |
134 | 179 | | |
135 | 180 | | |
136 | 181 | | |
| 182 | + | |
| 183 | + | |
137 | 184 | | |
138 | 185 | | |
139 | 186 | | |
| |||
149 | 196 | | |
150 | 197 | | |
151 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
152 | 202 | | |
153 | 203 | | |
154 | 204 | | |
| |||
169 | 219 | | |
170 | 220 | | |
171 | 221 | | |
| 222 | + | |
| 223 | + | |
172 | 224 | | |
173 | 225 | | |
174 | 226 | | |
| |||
201 | 253 | | |
202 | 254 | | |
203 | 255 | | |
| 256 | + | |
| 257 | + | |
204 | 258 | | |
| 259 | + | |
205 | 260 | | |
206 | 261 | | |
207 | 262 | | |
| |||
Lines changed: 0 additions & 211 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
0 commit comments