Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd267eb2 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Make battery settings use new battery graph." into nyc-dev

parents 91c2c969 9cc88e5e
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:orientation="vertical">

    <TextView
        android:id="@+id/charge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="36sp"
        android:textColor="?android:attr/colorAccent" />

    <TextView
        android:id="@+id/estimation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="8dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="?android:attr/textColorSecondary" />

    <com.android.settingslib.graph.UsageView
        android:id="@+id/battery_usage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        settings:sideLabels="@array/battery_labels"
        android:colorAccent="?android:attr/colorAccent"
        android:gravity="end"
        settings:textColor="?android:attr/textColorSecondary" />

</LinearLayout>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget_summary"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:textColor="?android:attr/textColorSecondary" />
+15 −0
Original line number Diff line number Diff line
@@ -7171,4 +7171,19 @@
    <!-- Title for suggestion adding more fingerprints [CHAR LIMIT=30] -->
    <string name="suggestion_additional_fingerprints">Additional Fingerprints</string>
    <!-- Summary of battery saver when on [CHAR LIMIT=NONE] -->
    <string name="battery_saver_on_summary">On / <xliff:g name="automatic_state" example="Never turn on automatically">%1$s</xliff:g></string>
    <!-- Summary of battery saver when off [CHAR LIMIT=NONE] -->
    <string name="battery_saver_off_summary">Off / <xliff:g name="automatic_state" example="Never turn on automatically">%1$s</xliff:g></string>
    <!-- [CHAR_LIMIT=NONE] Battery saver: Description for automatic entry option: Never -->
    <string name="battery_saver_desc_turn_on_auto_never">Never turn on automatically</string>
    <!-- [CHAR_LIMIT=NONE] Battery saver: Description for automatic entry option: pct% battery -->
    <string name="battery_saver_desc_turn_on_auto_pct">Turn on automatically at %1$s battery</string>
    <!-- [CHAR_LIMIT=NONE] Label for when app is ignoring battery optimizations -->
    <string name="not_battery_optimizing">Not using battery optimization</string>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,10 @@
        android:title="@string/power_usage_summary_title"
        settings:keywords="@string/keywords_battery">

        <com.android.settings.fuelgauge.BatterySaverPreference
            android:title="@string/battery_saver"
            android:fragment="com.android.settings.fuelgauge.BatterySaverSettings" />

        <com.android.settings.fuelgauge.BatteryHistoryPreference
            android:key="battery_history" />

+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ public class TintablePreference extends Preference {
        if (mTintColor != 0) {
            ((ImageView) view.findViewById(android.R.id.icon)).setImageTintList(
                    ColorStateList.valueOf(mTintColor));
        } else {
            ((ImageView) view.findViewById(android.R.id.icon)).setImageTintList(null);
        }
    }
}
Loading