Commit d00b9ef
committed
Dashboard: Give every charging-card value exactly one home
The card stated the same numbers up to six times: the level appeared in the
reading line, twice in a "40% -> 78%" row, as the curve's end label and twice
more in the chart legend. On a device held at its limit every span collapsed
to the same figure, so the card read as an echo of itself.
The middle row is gone. Elapsed time moves into the card header beside the
chevron via a new typed headerStatus on AmplyNavigationCard - the header
floats its trailing content and reports only the title's height, so this
costs no vertical space. It is a String rather than a composable slot on
purpose: the header sits inside the card's own tap target, so interactive
content there would have to opt out of the surface tap. A reserved minimum
title width plus a weighted status keep long values (duration never rolls
over into days, so "123h 59m" is reachable) from starving either the title
or the chevron.
The level range survives in the chart legend, stated as the session's range
rather than the plotted curve's span. The live curve is a bounded recent
window, so its own span quietly narrows from "40->80%" to "79->80%" while
the charge is still the same charge. percentRangeLabel defaults to the
curve's span, so an explicit null means "no range" instead of falling back
to the window - which is how the hub teaser, whose headline already carries
the range, keeps from stating it twice.
The compact chart drops its end labels, and no longer describes those
endpoints to screen readers either: its hosts render the current values one
line above, and the labels come from the last recorded sample, which lags by
a recorder tick. Dropping them also frees the right gutter for the curve.
It also refuses to draw without real variation. A device at its limit
produces flat series, and a zero-range series self-normalizes to the canvas
midpoint, so flat lines stacked into what looked like a plotted trend but
was really the "no range" fallback. Variation must come from an adjacent
non-null pair, because the path breaks at nulls: [40, null, 41] is two
one-point segments and draws nothing.
Both live surfaces now share one elapsed clock. Its first tick is aligned to
the next whole session-minute (a fixed minute delay starting at 2m59s would
hold the curve back to 3m59s), and it reads the clock on composition rather
than trusting a caller's captured snapshot, so a card scrolling back into a
lazy list doesn't re-enter holding a stale time.
Store screenshots are regenerated. Their fixture now pins "now" so a live
session has a believable age, and carries a real CC/CV curve - three linear
series self-normalize to identical shapes and drew on top of each other.1 parent 5424533 commit d00b9ef
14 files changed
Lines changed: 561 additions & 108 deletions
File tree
- app/src
- debug/java/eu/darken/amply/screenshots
- main/java/eu/darken/amply
- common/compose
- main/ui
- battery
- dashboard
- stats/ui
- test/java/eu/darken/amply
- main/ui
- battery
- dashboard
- stats/ui
- fastlane/metadata/android/en-US/images/phoneScreenshots
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
| |||
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
158 | 178 | | |
159 | 179 | | |
160 | 180 | | |
161 | 181 | | |
162 | 182 | | |
163 | 183 | | |
164 | | - | |
| 184 | + | |
165 | 185 | | |
166 | | - | |
| 186 | + | |
167 | 187 | | |
168 | 188 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
172 | 192 | | |
173 | 193 | | |
174 | 194 | | |
| |||
Lines changed: 68 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
293 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
294 | 302 | | |
295 | 303 | | |
296 | 304 | | |
| |||
312 | 320 | | |
313 | 321 | | |
314 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
315 | 329 | | |
316 | 330 | | |
317 | 331 | | |
| |||
327 | 341 | | |
328 | 342 | | |
329 | 343 | | |
| 344 | + | |
330 | 345 | | |
331 | 346 | | |
332 | 347 | | |
| |||
341 | 356 | | |
342 | 357 | | |
343 | 358 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
349 | 385 | | |
350 | 386 | | |
351 | 387 | | |
| |||
422 | 458 | | |
423 | 459 | | |
424 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
425 | 487 | | |
426 | 488 | | |
427 | 489 | | |
| |||
Lines changed: 14 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
| |||
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
| 32 | + | |
37 | 33 | | |
38 | | - | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
| |||
85 | 80 | | |
86 | 81 | | |
87 | 82 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
100 | 86 | | |
101 | 87 | | |
102 | 88 | | |
103 | 89 | | |
104 | 90 | | |
105 | 91 | | |
106 | 92 | | |
107 | | - | |
108 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
| |||
184 | 178 | | |
185 | 179 | | |
186 | 180 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 181 | | |
191 | 182 | | |
192 | 183 | | |
| |||
Lines changed: 28 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 15 | | |
23 | 16 | | |
24 | 17 | | |
| |||
40 | 33 | | |
41 | 34 | | |
42 | 35 | | |
| 36 | + | |
43 | 37 | | |
44 | | - | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
| |||
56 | 49 | | |
57 | 50 | | |
58 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
| 66 | + | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | | - | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
144 | | - | |
| 150 | + | |
145 | 151 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
169 | 161 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | 162 | | |
178 | 163 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 164 | + | |
| 165 | + | |
185 | 166 | | |
186 | 167 | | |
187 | 168 | | |
| |||
234 | 215 | | |
235 | 216 | | |
236 | 217 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | 218 | | |
241 | 219 | | |
242 | 220 | | |
| |||
0 commit comments