Commit Graph

4 Commits

Author SHA1 Message Date
Zaiyue Xue
284e049cc1 Switch Battery Usage Chart from V1 to V2.
Test: manual
Bug: 236101166
Change-Id: I9142c0d4e00dea3771777ba9aedeab07b635fa1a
2022-08-10 13:55:54 +08:00
Zaiyue Xue
8d0030d874 Fix b/241872474 Battery usage page will crash when selecting the last hour chart bar, going to app detail page, and going back
This bug is because we always use mHourlyChartIndex to construct
every view model in mHoulyViewModels. However, mHourlyChartIndex could
be got from saved instance. So mHourlyChartIndex may be out of bound in
some hourly view model which has not many hours data.

This fix removes the selectedIndex in BatteryChartViewModel constructor. Suppose the selectedIndex should be set everytime the view model is used.

Test: manual
Bug: 236101166
Bug: 241872474
Change-Id: I0bb5568ac33fcc23c406fe3af308b8d2706c5542
2022-08-09 16:39:36 +08:00
Zaiyue Xue
e9ab2f5365 Improve X axis labels in battery chart (1)
Support showing labels under the trapezoids instead of between the
trapezoids. For daily chart, the labels are under the trapezoids, for
hourly chart, the labels are between the trapezoids.

Test: manual
Bug: 239491373
Bug: 236101166
Change-Id: I2efb5192d4baafc7745ce269224639511848293e
2022-07-30 15:23:28 +00:00
Zaiyue Xue
05bf785859 Add battery chart view model.
Test: manual
Bug: 239491373
Bug: 236101166
Change-Id: I1ae0e5fcc006855ac552fbbdfb4cd73f3dec52e7
2022-07-26 06:34:43 +00:00