Tweak battery usage to match red lines.

Most of this is done, the main thing missing is the color
of the bars which seems like a framework issue.

Note that this introduces a change to the global theme
making colorControlActivated the specified blue color,
which impacts all of the settings UI.  (Except apparently
progress bars, and thus the bug.)

Change-Id: I4a5ca8c3b94dc23b8f065f60fe697ee0e76ff47d
This commit is contained in:
Dianne Hackborn
2014-05-30 17:59:27 -07:00
parent a391d9c6ac
commit 7158e62992
12 changed files with 237 additions and 130 deletions

View File

@@ -37,6 +37,9 @@ public class BatteryHistoryPreference extends Preference {
final private BatteryStats mStats;
final private Intent mBatteryBroadcast;
private boolean mHideLabels;
private View mLabelHeader;
public BatteryHistoryPreference(Context context, BatteryStats stats, Intent batteryBroadcast) {
super(context);
setLayoutResource(R.layout.preference_batteryhistory);
@@ -48,6 +51,15 @@ public class BatteryHistoryPreference extends Preference {
return mStats;
}
public void setHideLabels(boolean hide) {
if (mHideLabels != hide) {
mHideLabels = hide;
if (mLabelHeader != null) {
mLabelHeader.setVisibility(hide ? View.GONE : View.VISIBLE);
}
}
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
@@ -55,5 +67,7 @@ public class BatteryHistoryPreference extends Preference {
BatteryHistoryChart chart = (BatteryHistoryChart)view.findViewById(
R.id.battery_history_chart);
chart.setStats(mStats, mBatteryBroadcast);
mLabelHeader = view.findViewById(R.id.labelsHeader);
mLabelHeader.setVisibility(mHideLabels ? View.GONE : View.VISIBLE);
}
}