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
This commit is contained in:
jackqdyulei
2017-05-19 13:29:09 -07:00
parent 4d815d93ad
commit 605dbc66be
5 changed files with 241 additions and 74 deletions

View File

@@ -72,6 +72,10 @@ public class BatteryMeterView extends ImageView {
}
}
public int getBatteryLevel() {
return mDrawable.getBatteryLevel();
}
public void setCharging(boolean charging) {
mDrawable.setCharging(charging);
}