Adjust Battery Saver percentage slide size (sync from ag/13330588)

Screenshots:
     https://screenshot.googleplex.com/72qRevtZXA4PTcg.png
     https://screenshot.googleplex.com/3rJjDRehdsPL8AQ.png

Bug: 157532287
Bug: 202295741
Test: make SettingsGoogleRoboTests
Merged-In: Ia4453261c22919e325a971237efc79b4887362ec
Change-Id: I09fe6fe3de6da45959ee0babbd34202340ec661d
This commit is contained in:
ykhung
2021-10-13 11:26:15 +08:00
parent 502f53619f
commit 3c497cc715
2 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->
<!-- Layout used by BatterySaverScheduleSeekBarController for the seekbar widget. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="6dp"
android:gravity="center_vertical"
android:orientation="vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:layout_marginStart="18dp"
android:singleLine="true"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
android:textColor="?android:attr/textColorPrimary" />
<com.android.settings.widget.DefaultIndicatorSeekBar
android:id="@*android:id/seekbar"
style="@android:style/Widget.Material.SeekBar.Discrete"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="9dp" />
</LinearLayout>

View File

@@ -55,7 +55,7 @@ public class BatterySaverScheduleSeekBarController implements
public BatterySaverScheduleSeekBarController(Context context) {
mContext = context;
mSeekBarPreference = new SeekBarPreference(context);
mSeekBarPreference.setLayoutResource(R.layout.preference_widget_seekbar_settings);
mSeekBarPreference.setLayoutResource(R.layout.battery_saver_schedule_percentage_seekbar);
mSeekBarPreference.setIconSpaceReserved(false);
mSeekBarPreference.setOnPreferenceChangeListener(this);
mSeekBarPreference.setContinuousUpdates(true);