Merge "Considering to mainline moudle to move some resource to v31" into sc-dev

This commit is contained in:
Edgar Wang
2021-05-08 07:29:37 +00:00
committed by Android (Google) Code Review
14 changed files with 168 additions and 127 deletions

View File

@@ -0,0 +1,55 @@
<?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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:clipToPadding="false">
<LinearLayout
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
android:gravity="start|top"
android:orientation="horizontal"
android:paddingEnd="12dp"
android:paddingTop="16dp"
android:paddingBottom="4dp">
<ImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<com.android.settingslib.widget.LinkTextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:maxLines="10"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="marquee" />
</LinearLayout>

View File

@@ -23,7 +23,6 @@
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:clipToPadding="false">
<LinearLayout

View File

@@ -30,6 +30,6 @@
android:layout_marginLeft="@dimen/preference_dropdown_padding_start"
android:visibility="invisible" />
<include layout="@layout/settings_preference" />
<include layout="@layout/settingslib_preference" />
</FrameLayout>

View File

@@ -20,7 +20,7 @@
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/icon_min_width"
android:minWidth="48dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingLeft="0dp"

View File

@@ -29,7 +29,7 @@
android:clipToPadding="false"
android:baselineAligned="false">
<include layout="@layout/settings_icon"/>
<include layout="@layout/settingslib_icon_frame"/>
<RelativeLayout
android:layout_width="0dp"

View File

@@ -15,6 +15,6 @@
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<bool name="config_icon_space_reserved">false</bool>
<bool name="config_allow_divider">false</bool>
<bool name="settingslib_config_icon_space_reserved">false</bool>
<bool name="settingslib_config_allow_divider">false</bool>
</resources>

View File

@@ -16,10 +16,6 @@
-->
<resources>
<dimen name="preference_title_font_size">20sp</dimen>
<dimen name="icon_min_width">48dp</dimen>
<dimen name="preference_padding_start">24dp</dimen>
<dimen name="preference_padding_end">16dp</dimen>
<dimen name="app_preference_padding_start">20dp</dimen>
<dimen name="app_icon_min_width">52dp</dimen>
</resources>

View File

@@ -0,0 +1,66 @@
<?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.
-->
<resources>
<style name="PreferenceTheme.SettingsLib" parent="@style/PreferenceThemeOverlay">
<item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle.SettingsLib</item>
<item name="preferenceCategoryStyle">@style/SettingsCategoryPreference.SettingsLib</item>
<item name="preferenceStyle">@style/SettingsPreference.SettingsLib</item>
<item name="checkBoxPreferenceStyle">@style/SettingsCheckBoxPreference.SettingsLib</item>
<item name="dialogPreferenceStyle">@style/SettingsPreference.SettingsLib</item>
<item name="editTextPreferenceStyle">@style/SettingsEditTextPreference.SettingsLib</item>
<item name="dropdownPreferenceStyle">@style/SettingsDropdownPreference.SettingsLib</item>
<item name="switchPreferenceStyle">@style/SettingsSwitchPreference.SettingsLib</item>
<item name="seekBarPreferenceStyle">@style/SettingsSeekbarPreference.SettingsLib</item>
<item name="footerPreferenceStyle">@style/Preference.Material</item>
</style>
<style name="SettingsCategoryPreference.SettingsLib" parent="@style/Preference.Category.Material">
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
<item name="allowDividerAbove">@bool/settingslib_config_allow_divider</item>
<item name="allowDividerBelow">@bool/settingslib_config_allow_divider</item>
</style>
<style name="SettingsPreference.SettingsLib" parent="@style/Preference.Material">
<item name="layout">@layout/settingslib_preference</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
<style name="SettingsCheckBoxPreference.SettingsLib" parent="@style/Preference.CheckBoxPreference.Material">
<item name="layout">@layout/settingslib_preference</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
<style name="SettingsEditTextPreference.SettingsLib"
parent="@style/Preference.DialogPreference.EditTextPreference.Material">
<item name="layout">@layout/settingslib_preference</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
<style name="SettingsDropdownPreference.SettingsLib" parent="@style/Preference.DropDown.Material">
<item name="layout">@layout/settingslib_dropdown_preference</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
<style name="SettingsSwitchPreference.SettingsLib" parent="@style/Preference.SwitchPreference.Material">
<item name="layout">@layout/settingslib_preference</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
<style name="SettingsSeekbarPreference.SettingsLib" parent="@style/Preference.SeekBarPreference.Material">
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style>
</resources>

View File

@@ -15,8 +15,11 @@
limitations under the License.
-->
<resources>
<style name="TextAppearance.PreferenceTitle"
<style name="TextAppearance.PreferenceTitle.SettingsLib"
parent="@*android:style/TextAppearance.DeviceDefault.ListItem">
<item name="android:textSize">@dimen/preference_title_font_size</item>
<item name="android:textSize">20sp</item>
</style>
<style name="TextAppearance.CategoryTitle.SettingsLib"
parent="@*android:style/TextAppearance.DeviceDefault.Body2" />
</resources>

View File

@@ -0,0 +1,36 @@
<?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.
-->
<resources>
<!-- Only using in Settings application -->
<style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings" >
<item name="android:textAppearanceListItem">@style/TextAppearance.PreferenceTitle.SettingsLib</item>
<item name="android:listPreferredItemPaddingStart">24dp</item>
<item name="android:listPreferredItemPaddingEnd">16dp</item>
<item name="preferenceTheme">@style/PreferenceTheme.SettingsLib</item>
</style>
<!-- Using in SubSettings page including injected settings page -->
<style name="Theme.SubSettingsBase" parent="Theme.SettingsBase">
<!-- Suppress the built-in action bar -->
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!-- Set up edge-to-edge configuration for top app bar -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

View File

@@ -1,20 +0,0 @@
<?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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<bool name="config_icon_space_reserved">true</bool>
<bool name="config_allow_divider">true</bool>
</resources>

View File

@@ -17,10 +17,6 @@
<resources>
<dimen name="secondary_app_icon_size">32dp</dimen>
<dimen name="preference_title_font_size">16sp</dimen>
<dimen name="icon_min_width">56dp</dimen>
<dimen name="preference_padding_start">?android:attr/dialogPreferredPadding</dimen>
<dimen name="preference_padding_end">?android:attr/dialogPreferredPadding</dimen>
<dimen name="app_preference_padding_start">?android:attr/listPreferredItemPaddingStart</dimen>
<dimen name="app_icon_min_width">56dp</dimen>
</resources>

View File

@@ -1,82 +0,0 @@
<?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.
-->
<resources>
<!--DEPRECATED. It will be removed after all of client teams migrated to new style. -->
<style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/SettingsCategoryPreference</item>
<item name="preferenceStyle">@style/SettingsPreference</item>
<item name="checkBoxPreferenceStyle">@style/SettingsCheckBoxPreference</item>
<item name="dialogPreferenceStyle">@style/SettingsPreference</item>
<item name="editTextPreferenceStyle">@style/SettingsEditTextPreference</item>
<item name="dropdownPreferenceStyle">@style/SettingsDropdownPreference</item>
<item name="switchPreferenceStyle">@style/SettingsSwitchPreference</item>
<item name="seekBarPreferenceStyle">@style/SettingsSeekbarPreference</item>
<item name="footerPreferenceStyle">@style/Preference.Material</item>
</style>
<style name="PreferenceTheme.SettingsBase" parent="@style/PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/SettingsCategoryPreference</item>
<item name="preferenceStyle">@style/SettingsPreference</item>
<item name="checkBoxPreferenceStyle">@style/SettingsCheckBoxPreference</item>
<item name="dialogPreferenceStyle">@style/SettingsPreference</item>
<item name="editTextPreferenceStyle">@style/SettingsEditTextPreference</item>
<item name="dropdownPreferenceStyle">@style/SettingsDropdownPreference</item>
<item name="switchPreferenceStyle">@style/SettingsSwitchPreference</item>
<item name="seekBarPreferenceStyle">@style/SettingsSeekbarPreference</item>
<item name="footerPreferenceStyle">@style/Preference.Material</item>
</style>
<style name="SettingsCategoryPreference" parent="@style/Preference.Category.Material">
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
<item name="allowDividerAbove">@bool/config_allow_divider</item>
<item name="allowDividerBelow">@bool/config_allow_divider</item>
</style>
<style name="SettingsPreference" parent="@style/Preference.Material">
<item name="layout">@layout/settings_preference</item>
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingsCheckBoxPreference" parent="@style/Preference.CheckBoxPreference.Material">
<item name="layout">@layout/settings_preference</item>
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingsEditTextPreference"
parent="@style/Preference.DialogPreference.EditTextPreference.Material">
<item name="layout">@layout/settings_preference</item>
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingsDropdownPreference" parent="@style/Preference.DropDown.Material">
<item name="layout">@layout/settings_dropdown_preference</item>
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingsSwitchPreference" parent="@style/Preference.SwitchPreference.Material">
<item name="layout">@layout/settings_preference</item>
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingsSeekbarPreference" parent="@style/Preference.SeekBarPreference.Material">
<item name="iconSpaceReserved">@bool/config_icon_space_reserved</item>
</style>
<style name="SettingFooterPreference" parent="@style/Preference.Material">
<item name="allowDividerAbove">@bool/config_allow_divider</item>
</style>
</resources>

View File

@@ -17,20 +17,12 @@
<resources>
<!-- Only using in Settings application -->
<style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings" >
<item name="android:textAppearanceListItem">@style/TextAppearance.PreferenceTitle</item>
<item name="android:listPreferredItemPaddingStart">@dimen/preference_padding_start</item>
<item name="android:listPreferredItemPaddingEnd">@dimen/preference_padding_end</item>
<item name="preferenceTheme">@style/PreferenceTheme.SettingsBase</item>
</style>
<style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings" />
<!-- Using in SubSettings page including injected settings page -->
<style name="Theme.SubSettingsBase" parent="Theme.SettingsBase">
<!-- Suppress the built-in action bar -->
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!-- Set up edge-to-edge configuration for top app bar -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>