diff options
| author | 2023-11-13 03:52:58 +0000 | |
|---|---|---|
| committer | 2023-11-13 03:52:58 +0000 | |
| commit | 3706e20be2f9e7fe88ea6dca0705e2bccd7fac53 (patch) | |
| tree | 121c63548af0e05ec07f41ba2ee5db4d61c03c05 | |
| parent | 5533a4d97b1fae76ffdfce1cc7d83b4124890338 (diff) | |
| parent | 259d1e6e2a973d6dc195b0167e8295f5c01131ed (diff) | |
Merge "Split settingslib_main_switch" into main
5 files changed, 53 insertions, 24 deletions
diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch.xml b/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch.xml new file mode 100644 index 000000000000..1ffdad47bd3c --- /dev/null +++ b/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch.xml @@ -0,0 +1,25 @@ +<?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. + --> + +<Switch + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/switch_widget" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:clickable="false" + android:focusable="false" + android:theme="@style/Switch.SettingsLib" /> diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch_bar.xml b/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch_bar.xml index e3f8fbb88a65..1054e0017cf1 100644 --- a/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch_bar.xml +++ b/packages/SettingsLib/MainSwitchPreference/res/layout-v31/settingslib_main_switch_bar.xml @@ -47,14 +47,7 @@ android:textAppearance="?android:attr/textAppearanceListItem" style="@style/MainSwitchText.Settingslib" /> - <Switch - android:id="@android:id/switch_widget" - android:layout_width="wrap_content" - android:layout_height="48dp" - android:layout_gravity="center_vertical" - android:focusable="false" - android:clickable="false" - android:theme="@style/Switch.SettingsLib"/> + <include layout="@layout/settingslib_main_switch" /> </LinearLayout> </LinearLayout> diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout-v33/settingslib_main_switch_bar.xml b/packages/SettingsLib/MainSwitchPreference/res/layout-v33/settingslib_main_switch_bar.xml index 255b2c92e709..4a0e7b377412 100644 --- a/packages/SettingsLib/MainSwitchPreference/res/layout-v33/settingslib_main_switch_bar.xml +++ b/packages/SettingsLib/MainSwitchPreference/res/layout-v33/settingslib_main_switch_bar.xml @@ -49,14 +49,7 @@ android:lineBreakWordStyle="phrase" style="@style/MainSwitchText.Settingslib" /> - <Switch - android:id="@android:id/switch_widget" - android:layout_width="wrap_content" - android:layout_height="48dp" - android:layout_gravity="center_vertical" - android:focusable="false" - android:clickable="false" - android:theme="@style/Switch.SettingsLib"/> + <include layout="@layout/settingslib_main_switch" /> </LinearLayout> </LinearLayout> diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch.xml b/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch.xml new file mode 100644 index 000000000000..12c1d76e9ae4 --- /dev/null +++ b/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch.xml @@ -0,0 +1,25 @@ +<?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. + --> + +<Switch + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/switch_widget" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:clickable="false" + android:focusable="false" + android:theme="@style/SwitchBar.Switch.Settingslib" /> diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch_bar.xml b/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch_bar.xml index bf34db93298b..fe64fea2d7cc 100644 --- a/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch_bar.xml +++ b/packages/SettingsLib/MainSwitchPreference/res/layout/settingslib_main_switch_bar.xml @@ -38,13 +38,6 @@ android:layout_marginStart="@dimen/settingslib_switchbar_subsettings_margin_start" android:textAlignment="viewStart"/> - <Switch - android:id="@android:id/switch_widget" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:focusable="false" - android:clickable="false" - android:theme="@style/SwitchBar.Switch.Settingslib"/> + <include layout="@layout/settingslib_main_switch" /> </LinearLayout> |