Split battery header text to a separated preference

This is a no-op refactor. This change makes the Catalyst migration of battery level bar easy.

Bug: 372774754
Test: manual
Flag: EXEMPT bug fix
Change-Id: I6e64e6d9b34aeca584f4d4e951c58c3e1b361f9d
This commit is contained in:
Zaiyue Xue
2024-11-20 17:06:49 +08:00
parent 0a06641369
commit 178eb0bd15
8 changed files with 183 additions and 647 deletions

View File

@@ -0,0 +1,32 @@
<!--
~ Copyright (C) 2024 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:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingBottom="16dp">
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textSize="14sp"/>
</LinearLayout>

View File

@@ -25,8 +25,14 @@
android:key="battery_header"
android:title="@string/summary_placeholder"
android:selectable="false"
android:paddingBottom="0px"
settings:controller="com.android.settings.fuelgauge.BatteryHeaderPreferenceController" />
<com.android.settings.fuelgauge.BatteryHeaderTextPreference
android:key="battery_header_text"
android:selectable="false"
settings:controller="com.android.settings.fuelgauge.BatteryHeaderTextPreferenceController" />
<com.android.settingslib.widget.LayoutPreference
android:key="battery_help_message"
android:layout="@layout/preference_battery_error"