Merge "Revamp battery Ui in low battery mode" into oc-dev

This commit is contained in:
Lei Yu
2017-04-13 21:43:32 +00:00
committed by Android (Google) Code Review
7 changed files with 138 additions and 27 deletions

View File

@@ -561,14 +561,15 @@ public class PowerUsageSummary extends PowerUsageBase {
.findViewById(R.id.battery_header_icon);
final TextView timeText = (TextView) mBatteryLayoutPref.findViewById(R.id.battery_percent);
final TextView summary1 = (TextView) mBatteryLayoutPref.findViewById(R.id.summary1);
timeText.setText(Utils.formatPercentage(info.mBatteryLevel));
timeText.setText(Utils.formatPercentage(info.batteryLevel));
if (info.remainingLabel == null ) {
summary1.setText(info.statusLabel);
} else {
summary1.setText(info.remainingLabel);
}
batteryView.setBatteryInfo(info.mBatteryLevel);
batteryView.setBatteryLevel(info.batteryLevel);
batteryView.setCharging(!info.discharging);
}
@VisibleForTesting
@@ -695,7 +696,7 @@ public class PowerUsageSummary extends PowerUsageBase {
BatteryInfo.getBatteryInfo(mContext, new BatteryInfo.Callback() {
@Override
public void onBatteryInfoLoaded(BatteryInfo info) {
mLoader.setSummary(SummaryProvider.this, info.mChargeLabelString);
mLoader.setSummary(SummaryProvider.this, info.chargeLabelString);
}
});
}