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
This commit is contained in:
jackqdyulei
2017-02-02 11:25:15 -08:00
parent 3fca717d3b
commit 51967c0e6a
15 changed files with 366 additions and 38 deletions

View File

@@ -59,7 +59,6 @@ public class LayoutPreference extends Preference {
private void setView(View view) {
setLayoutResource(R.layout.layout_preference_frame);
setSelectable(false);
final ViewGroup allDetails = (ViewGroup) view.findViewById(R.id.all_details);
if (allDetails != null) {
Utils.forceCustomPadding(allDetails, true /* additive padding */);
@@ -70,6 +69,7 @@ public class LayoutPreference extends Preference {
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
FrameLayout layout = (FrameLayout) view.itemView;
layout.removeAllViews();
ViewGroup parent = (ViewGroup) mRootView.getParent();