Files
app_Settings/res/xml/battery_saver_settings.xml
Fan Zhang db03de4e80 Convert BatterySaverButton controller to Slice compatible.
- Update preference key to match the key defined in SettingsSlicesContract
- Model TwoStateButtonPreference similar to TwoStatePreference (add
  setChecked, isChecked method)
- Remove TwoStateButtonPreferenceController entirely because all methods
  are moved into Preference directly for better encapsulation.
- Make BatterySaverButtonPrefController direclty implement
  TogglePreferenceController. It was not possible before because the
  interface between TwoStateButtonPreferene is too different from
  TwoStatePreference.

Bug: 80106671
Test: robotests
Change-Id: Ib72807dcf1b36e959e08df8d80538c3f9f79b76d
Merged-In: Ib72807dcf1b36e959e08df8d80538c3f9f79b76d
2018-05-23 08:00:41 -07:00

53 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/battery_saver"
android:key="battery_saver_page">
<!-- Turn on automatically -->
<SwitchPreference
android:key="auto_battery_saver"
android:title="@string/battery_saver_auto_title"
settings:controller="com.android.settings.fuelgauge.batterysaver.AutoBatterySaverPreferenceController" />
<com.android.settings.widget.SeekBarPreference
android:key="battery_saver_seek_bar"
android:title="@string/battery_saver_seekbar_title_placeholder"
android:max="75"
android:min="5" />
<com.android.settings.widget.TwoStateButtonPreference
android:key="battery_saver"
android:title="@string/battery_saver"
android:selectable="false"
settings:textOn="@string/battery_saver_button_turn_on"
settings:textOff="@string/battery_saver_button_turn_off"
settings:platform_slice="true"
settings:controller="com.android.settings.fuelgauge.batterysaver.BatterySaverButtonPreferenceController" />
<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>