[battery] batteries are like onions
They have layers
This CL does a few things:
- update the battery colors:
- new green, yellow, red
- low-alpha for the percentage numbers
- the non-filled portion of the light-mode icons is bumped down to 20%
alpha from 35%
- Updated the number glyphs and attribution glyphs
- The battery is now 13sp tall and 26.5sp wide
- Attributions are drawn as a layer on top of the battery, with 20%
overlap
- The battery cap only draws if there is no attribution
- The percentage will show even at 100%
- The battery composable is drawn as a Layout so that positioning can
take place without recomposition
- Recomposition will not take place when the level changes
A note on testing: I added logs to the layout, composition, and drawing
stages of the compose pipeline, and manually verified the cases when
recomposition takes place. This is not the most robust way to validate
the performance, but it is a relatively reliable metric for figuring out
when we are doing too much work.
This composable will not recompose or relayout when the color or levels
change, and should only recompose when the battery state changes. This
is necessary since the width will also change in those cases.
Test: screenshot tests
Test: BatteryViewModelTest
Test: manually via `adb shell cmd battery` commands
Bug: 404930547
Flag: com.android.settingslib.flags.new_status_bar_icons
Flag: com.android.systemui.status_bar_root_modernization
Change-Id: I766fb04d296a3ec1b71cc3f92f6846a5a4d573bb
Loading
Please register or sign in to comment