Migrate MainSwitchBar in Settings to Material3
Settings UI changed in this cl. Bug: 306658346 Test: manual - on Settings pages Change-Id: I06f0cef90453c20855e71ea96c7bca72d1fb1017
This commit is contained in:
63
res/layout-v34/settingslib_main_switch_bar.xml
Normal file
63
res/layout-v34/settingslib_main_switch_bar.xml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2023 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_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
|
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||||
|
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||||
|
android:paddingTop="@dimen/settingslib_switchbar_margin"
|
||||||
|
android:paddingBottom="@dimen/settingslib_switchbar_margin"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frame"
|
||||||
|
android:minHeight="@dimen/settingslib_min_switch_bar_height"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
||||||
|
android:paddingEnd="@dimen/settingslib_switchbar_padding_right"
|
||||||
|
android:background="@drawable/settingslib_switch_bar_bg">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/switch_text"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginEnd="@dimen/settingslib_switch_title_margin"
|
||||||
|
android:layout_marginVertical="@dimen/settingslib_switch_title_margin"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||||
|
android:hyphenationFrequency="normalFast"
|
||||||
|
android:lineBreakWordStyle="phrase"
|
||||||
|
style="@style/MainSwitchText.Settingslib" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@android:id/switch_widget"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:background="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
Reference in New Issue
Block a user