Fix and update battery detail page

Bug: 27205329
Change-Id: Ie984348d59c1b15bec7283a94a94489f78cacb79
This commit is contained in:
Jason Monk
2016-02-23 12:45:20 -05:00
parent 60df76b169
commit d1ea8a05b0
9 changed files with 523 additions and 9 deletions

View File

@@ -44,10 +44,11 @@ public class BatteryHistoryPreference extends Preference {
public BatteryHistoryPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setLayoutResource(R.layout.battery_usage_graph);
setSelectable(true);
}
@Override
protected void onClick() {
public void performClick() {
mHelper.storeStatsHistoryInFile(BATTERY_HISTORY_FILE);
Bundle args = new Bundle();
args.putString(BatteryHistoryDetail.EXTRA_STATS, BATTERY_HISTORY_FILE);
@@ -66,9 +67,11 @@ public class BatteryHistoryPreference extends Preference {
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
if (mBatteryInfo == null) {
return;
}
view.itemView.setClickable(true);
view.setDividerAllowedAbove(true);
((TextView) view.findViewById(R.id.charge)).setText(mBatteryInfo.batteryPercentString);
((TextView) view.findViewById(R.id.estimation)).setText(mBatteryInfo.remainingLabel);