Commit Graph

23 Commits

Author SHA1 Message Date
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Jun Lan
cca804e1ed Format battery java code
After this CL, we can follow Guideline:go/hc-mainline-dev#format-code to keep java format consistent.

Test: manual
Bug: 304439460
Change-Id: I5bb77f81b0bd9be618e34942eaaee8296bc42796
2023-11-06 13:55:48 +08:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Evan Laird
4393d200b6 Use ColorMatrixColorFilter in batterymeterview
the old PorterDuff color filter didn't allow us to pass through the
drawable's alpha.

Test: manual
Bug: 162901879
Change-Id: I1ad7d9a0177c7a25d1c6a5a8437c27f60390f45e
2020-10-28 14:21:30 -04:00
timhypeng
c71f996da9 Battery icon is too large
-sync layout from SystemUI

Bug: 141139595
Test: make -j42 RunSettingsRoboTests
Change-Id: I5e165e953682fcfdebf0d06475bb1abd171684d9
2019-11-14 10:55:54 +08:00
Lei Yu
eba850e8d9 Update color filter for battery saver mode
Fixes: 129498556
Test: Manual
Change-Id: I57809c77e488b9828bea50d4c4f410d49912cd4b
2019-04-24 13:47:39 -07:00
Lei Yu
2632f45010 Fix battery robo test
Fixes: 130896701
Test: RunSettingsRoboTests
Change-Id: Iffb7874250335db81181b23f96fe7b50a2dd0062
2019-04-19 13:41:22 -07:00
Evan Laird
3e98ff34d0 Turn off LAYER_TYPE_SOFTWARE on BatteryMeterView
ThemedBatteryDrawable will no longer need it due to drawing more
betterer

Test: battery should look the same
Bug: 129014647
Change-Id: I6706cec2b3c3bfbdc0e0456c58191bc7152783e7
2019-04-11 10:52:14 -04:00
Evan Laird
35e35622d9 Use ThemedBatteryDrawable in settings
Changed out BatteryMeterDrawable to inherit from ThemedBatteryDrawable
instead of BatteryMeterDrawableBase. Also removed warning text paint
because it seemed unused and simplified the interface.

Bug: 123705805
Test: visual
Change-Id: I30496e3d8881803d9d3d8a316c10387482a8f610
2019-02-26 14:11:58 -05:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Weien Wang
27e9617c16 Fix the battery icon on the battery page when low battery
Check power-saving state for drawing the battery icon on the battery page.
It will draw red + icon as status-bar did when battery saver is on.

Change-Id: Iee4a17c8e5cb3c8ee5d978eb23e3980597d09a1c
Fixes: 77150820
Test: Manual test, atest BatteryMeterViewTest BatteryHeaderPreferenceControllerTest
2018-05-24 08:05:15 +00:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Jason Chang
c44097d345 [SettingsLib] Update Utils APIs usage
Update Utils.getColorAttr and similar methods in Utils to return a ColorStateList instead of a color

Bug: 74872054
Test: Force to display different color items then manually test
Change-Id: If002f9a578558e6254220c36ef556e8378d4522a
2018-04-10 21:09:39 +08:00
jackqdyulei
19648756cb Add quickUpdate method to BatteryHeaderPrefCtrl
This cl adds a method called quickUpdateHeaderPreference, which will
update the following items immediately without waiting for the
BatteryInfo:
1. Battery level
2. Battery charging status(whether to show lighting bolt)
3. Clear the charging summary

Note: this cl doesn't optimize the BatteryInfo loading time.

This cl also rename "TimeText" to "BatteryPercentText" because in
new UI that textview is used to display battery percentage.

Bug: 63029231
Test: RunSettingsRoboTests
Change-Id: I8cc886b35e937d73b46e47e303ff0994ccdcb61c
2017-06-27 13:35:41 -07:00
jackqdyulei
605dbc66be Split loading process for battery header
This cl creates BatteryHeaderPreferenceController, which will first
load the battery level in ui thread(in displayPreference()), then
display the remaining time once we get the battery stats.

This is the best we can do to avoid ui flashing while removing the
animation

Bug: 38349587
Test: RunSettingsRoboTests

Change-Id: Ic3622bb73562ba42e69b37e5674a724c03c45f12
2017-05-23 13:22:42 -07:00
Daniel Nishi
8b8f27cd06 Merge "Fix storage summary background colors." into oc-dev 2017-05-23 17:35:19 +00:00
Lei Yu
78684dc049 Revert "Add animation for battery asyncLoader."
This reverts commit a3c528f64d.

Test: Build
Change-Id: Ib50221873e39dee40c5cf8e4b41dcf7aa13f6134
Merged-In: Ib50221873e39dee40c5cf8e4b41dcf7aa13f6134
2017-05-22 16:49:55 -07:00
Daniel Nishi
12dbce00c1 Fix storage summary background colors.
This changes the donut background color to a lighter blue and changes
the overall background to be a grey. Both of these colors match the
Battery implementation.

Bug: 35245772
Test: Manual
Change-Id: I8e12afe4434a0e2428384fc496cab5c05dc998ee
2017-05-18 11:36:10 -07:00
jackqdyulei
a3c528f64d Add animation for battery asyncLoader.
When battery asyncLoader is loading batterystats, show a battery
placeholder(critical level) and animate to real status once data is
loaded.

Bug: 35917699
Test: RunSettingsRoboTests
Change-Id: Ie4ff73ff2cc0b9e17b4541e3284bf2ac34da42c4
Merged-In: Ie4ff73ff2cc0b9e17b4541e3284bf2ac34da42c4
2017-05-11 15:27:23 -07:00
jackqdyulei
f8e6f43425 Revamp battery Ui in low battery mode
This cl refine battery icon ui in low battery mode:
1. Should show indicator(fixed in ag/2035178)
2. Show bolt icon when charging
3. When battery is low, set battery background as red and indicator
as white.

This cl also includes the field updates for battery.

Bug: 36862496
Test: RunSettingsRoboTests
Change-Id: Ifb2ed339742119bbff78712df09288b895756b1f
2017-04-12 12:47:52 -07:00
jackqdyulei
273ad50a3a Ui changes in battery main page
1. Refine the battery header view
2. Move stats section to the place above power management
3. Add last full charge battery stat
4. Add the disclaimer as a footer

Also update the method name in test file, and this ui changes
also fix the header flash problem.

Bug: 36576021
Bug: 36494178
Test: RunSettingsRoboTests
Change-Id: I9784dbbbe16e61da7287f300183347dd4eee6a2b
(cherry picked from commit edfd09d590)
2017-04-04 10:06:35 -07:00
jackqdyulei
51967c0e6a Add BatteryMeterView in Settings
1. Show gauge icon at the top of battery main page instead of
battery usage graph.
2. Move the click action from battery usage graph to gauge icon.

Bug: 34387464
Test: RunSettingsRoboTest

Change-Id: Ib182619d6805b401cde03a50e2ae907cf4df7b94
2017-02-13 11:03:07 -08:00