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

Commit f8caf69d authored by Lei Yu's avatar Lei Yu Committed by Android (Google) Code Review
Browse files

Merge changes from topic "battery_saver_step_1"

* changes:
  Add preference controller for battery seekbar
  Revamp the battery saver page
parents 948191bc b77fec08
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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"
    android:orientation="horizontal"
    android:gravity="bottom"
    android:paddingStart="72dp"
    android:paddingEnd="72dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/battery_saver_on_button"
        style="@style/ActionPrimaryButton"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/battery_saver_button_turn_on"
        android:paddingEnd="8dp" />

    <Button
        android:id="@+id/battery_saver_off_button"
        style="@style/ActionSecondaryButton"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/battery_saver_button_turn_off"
        android:paddingEnd="8dp" />

</LinearLayout>
 No newline at end of file
+20 −2
Original line number Diff line number Diff line
@@ -5159,8 +5159,17 @@
    <!-- Label for dex2oat process in battery usage used for the optimization of one or more apps -->
    <string name="process_dex2oat_label">App optimization</string>
    <!-- [CHAR_LIMIT=40] Battery saver: Label for feature, title + menu item -->
    <string name="battery_saver">Battery Saver</string>
    <!-- Battery saver: Label for feature, title + menu item [CHAR_LIMIT=40] -->
    <string name="battery_saver">Reduced power mode</string>
    <!-- Battery saver: Label for preference to turn on battery saver automatically when battery is low [CHAR_LIMIT=40] -->
    <string name="battery_saver_auto_title">Schedule</string>
    <!-- Battery saver: Summary for preference to turn on battery saver automatically when battery is low [CHAR_LIMIT=40] -->
    <string name="battery_saver_auto_summary">Turn on Reduced power mode automatically when battery is low</string>
    <!-- Battery saver: Label for seekbar to change battery saver threshold [CHAR_LIMIT=40] -->
    <string name="battery_saver_seekbar_title">Turn on automatically at <xliff:g id="percent">%1$s</xliff:g></string>
    <!-- Used in the Battery Saver settings screen to control turning on/off the feature entirely -->
    <string name="battery_saver_master_switch_title">Use Battery Saver</string>
@@ -8733,6 +8742,12 @@
    <!-- [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>
    <!--  Battery saver: Label for button that will turn on battery saver. [CHAR LIMIT=30] -->
    <string name="battery_saver_button_turn_on">Turn on now</string>
    <!--  Battery saver: Label for button that will turn off battery saver. [CHAR LIMIT=30] -->
    <string name="battery_saver_button_turn_off">Turn off now</string>
    <!-- [CHAR_LIMIT=NONE] Label for when app is ignoring battery optimizations -->
    <string name="not_battery_optimizing">Not using battery optimization</string>
@@ -9287,6 +9302,9 @@
    <!-- Help URI, USB Audio [DO NOT TRANSLATE] -->
    <string name="help_url_audio_accessory_not_supported" translatable="false"></string>
    <!-- Help URI, battery saver page [DO NOT TRANSLATE] -->
    <string name="help_url_battery_saver_settings" translatable="false"></string>
    <!-- Title label for new device suggestion, which is displayed in Settings homepage [CHAR LIMIT=100] -->
    <string name="new_device_suggestion_title">What\'s new and exciting?</string>
+25 −7
Original line number Diff line number Diff line
@@ -14,14 +14,32 @@
     limitations under the License.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="@string/battery_saver"
    android:key="battery_saver">

    <!-- Turn on automatically -->
    <DropDownPreference
            android:key="turn_on_automatically"
            android:title="@string/battery_saver_turn_on_automatically_title"
            android:summary="%s" />
    <SwitchPreference
        android:key="auto_battery_saver"
        android:title="@string/battery_saver_auto_title"
        android:summary="@string/battery_saver_auto_summary"/>
    <com.android.settings.widget.SeekBarPreference
        android:key="battery_saver_seek_bar"
        android:title="@string/battery_saver_seekbar_title"
        android:max="75"
        android:min="5"/>
    <com.android.settings.applications.LayoutPreference
        android:key="battery_saver_button_container"
        android:selectable="false"
        android:layout="@layout/battery_saver_settings_button"/>

    <PreferenceCategory
        android:key="battery_saver_footer">
        <com.android.settingslib.widget.FooterPreference
            android:key="battery_saver_footer_preference"
            android:title="@*android:string/battery_saver_description"
            android:selectable="false"/>
    </PreferenceCategory>

</PreferenceScreen>
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
        android:key="power_management">

        <com.android.settings.widget.MasterSwitchPreference
            android:fragment="com.android.settings.fuelgauge.BatterySaverSettings"
            android:fragment="com.android.settings.fuelgauge.batterysaver.BatterySaverSettings"
            android:key="battery_saver_summary"
            android:title="@string/battery_saver"/>

+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@
        android:title="@string/battery_power_management">

        <com.android.settings.widget.MasterSwitchPreference
            android:fragment="com.android.settings.fuelgauge.BatterySaverSettings"
            android:fragment="com.android.settings.fuelgauge.batterysaver.BatterySaverSettings"
            android:key="battery_saver_summary"
            android:title="@string/battery_saver"/>

Loading