Revert "Update preferences to Material Next styling"

Revert "Add dependency for settings activity collapsing toolbar"

Revert submission 14740617-collapse3

Reason for revert: Build breakage
Reverted Changes:
I5ef658979:Add dependency for settings activity collapsing to...
I0ca55eecb:Update preferences to Material Next styling

Bug: 189919452
Change-Id: I4aa0bfc473334266a951d84064b4e8e406fff0a4
This commit is contained in:
Weilun Du
2021-06-02 20:24:50 +00:00
parent 9b8ab05a17
commit 19d623d921
12 changed files with 6 additions and 337 deletions
-1
View File
@@ -112,7 +112,6 @@ android_library {
"androidx.preference_preference",
"androidx.slice_slice-view",
"androidx.cardview_cardview",
"com.google.android.material_material",
"iconloader_base",
],
manifest: "AndroidManifest-common.xml",
+1 -1
View File
@@ -144,7 +144,7 @@
<activity
android:name="com.android.launcher3.settings.SettingsActivity"
android:label="@string/settings_button_text"
android:theme="@style/HomeSettings.Theme"
android:theme="@style/HomeSettingsTheme"
android:exported="true"
android:autoRemoveFromRecents="true">
<intent-filter>
@@ -1,27 +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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@color/home_settings_thumb_off_color" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@color/home_settings_thumb_off_color" />
<!-- Enabled or toggle on status of thumb -->
<item android:color="@color/home_settings_state_on_color" />
</selector>
@@ -1,28 +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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@color/home_settings_track_off_color"
android:alpha="?android:attr/disabledAlpha" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@color/home_settings_track_off_color" />
<!-- Enabled or toggle on status of thumb -->
<item android:color="@color/home_settings_track_on_color" />
</selector>
@@ -1,29 +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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="4dp"
android:left="4dp"
android:right="4dp"
android:bottom="4dp">
<shape android:shape="oval" >
<size android:height="20dp" android:width="20dp" />
<solid android:color="@color/home_settings_switch_thumb_color" />
</shape>
</item>
</layer-list>
@@ -1,26 +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.
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:width="52dp"
android:height="28dp">
<solid android:color="@color/home_settings_switch_track_color" />
<corners android:radius="35dp" />
</shape>
-69
View File
@@ -1,69 +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.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/colorPrimary"
android:fitsSystemWindows="true"
android:outlineAmbientShadowColor="@android:color/transparent"
android:outlineSpotShadowColor="@android:color/transparent"
android:theme="@style/HomeSettings.CollapsingToolbar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="226dp"
android:clipToPadding="false"
app:collapsedTitleTextAppearance="@style/HomeSettings.CollapsedToolbarTitle"
app:contentScrim="@color/home_settings_header_collapsed"
app:expandedTitleMarginEnd="24dp"
app:expandedTitleMarginStart="24dp"
app:expandedTitleTextAppearance="@style/HomeSettings.ExpandedToolbarTitle"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:maxLines="3"
app:scrimAnimationDuration="50"
app:scrimVisibleHeightTrigger="174dp"
app:statusBarScrim="@null"
app:titleCollapseMode="fade"
app:toolbarId="@id/action_bar">
<Toolbar
android:id="@+id/action_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="?android:attr/actionBarTheme"
android:transitionName="shared_element_view"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
-27
View File
@@ -1,27 +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>
<color name="home_settings_header_accent">@android:color/system_accent1_100</color>
<color name="home_settings_header_collapsed">@android:color/system_neutral1_700</color>
<color name="home_settings_header_expanded">@android:color/system_neutral1_900</color>
<color name="home_settings_thumb_off_color">@android:color/system_neutral2_300</color>
<color name="home_settings_track_on_color">@android:color/system_accent2_700</color>
<color name="home_settings_track_off_color">@android:color/system_neutral1_700</color>
</resources>
-9
View File
@@ -37,13 +37,4 @@
<color name="wallpaper_popup_scrim">@android:color/system_neutral1_900</color>
<color name="home_settings_header_accent">@android:color/system_accent1_600</color>
<color name="home_settings_header_collapsed">@android:color/system_neutral1_100</color>
<color name="home_settings_header_expanded">@android:color/system_neutral1_50</color>
<color name="home_settings_state_on_color">@android:color/system_accent1_100</color>
<color name="home_settings_state_off_color">@android:color/system_accent2_100</color>
<color name="home_settings_thumb_off_color">@android:color/system_neutral2_100</color>
<color name="home_settings_track_on_color">@android:color/system_accent1_600</color>
<color name="home_settings_track_off_color">@android:color/system_neutral2_600</color>
</resources>
-20
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>
<bool name="home_settings_icon_space_reserved">false</bool>
<bool name="home_settings_allow_divider">false</bool>
</resources>
-95
View File
@@ -1,95 +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>
<style name="HomeSettings.Theme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:listPreferredItemPaddingEnd">16dp</item>
<item name="android:listPreferredItemPaddingStart">24dp</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:switchStyle">@style/HomeSettings.SwitchStyle</item>
<item name="android:textAppearanceListItem">@style/HomeSettings.PreferenceTitle</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="preferenceTheme">@style/HomeSettings.PreferenceTheme</item>
</style>
<style name="HomeSettings.PreferenceTheme" parent="@style/PreferenceThemeOverlay">
<item name="preferenceCategoryStyle">@style/HomeSettings.CategoryStyle</item>
<item name="preferenceCategoryTitleTextAppearance">@style/HomeSettings.CategoryTitle</item>
<item name="preferenceFragmentCompatStyle">@style/HomeSettings.FragmentCompatStyle</item>
<item name="preferenceScreenStyle">@style/HomeSettings.PreferenceScreenStyle</item>
<item name="preferenceStyle">@style/HomeSettings.PreferenceStyle</item>
<item name="switchPreferenceStyle">@style/HomeSettings.SwitchPreferenceStyle</item>
</style>
<style name="HomeSettings.CategoryStyle" parent="@style/Preference.Category.Material">
<item name="allowDividerAbove">@bool/home_settings_allow_divider</item>
<item name="allowDividerBelow">@bool/home_settings_allow_divider</item>
<item name="iconSpaceReserved">@bool/home_settings_icon_space_reserved</item>
</style>
<style name="HomeSettings.PreferenceStyle" parent="@style/Preference.Material">
<item name="iconSpaceReserved">@bool/home_settings_icon_space_reserved</item>
</style>
<style name="HomeSettings.PreferenceScreenStyle"
parent="@style/Preference.PreferenceScreen.Material">
<item name="iconSpaceReserved">@bool/home_settings_icon_space_reserved</item>
</style>
<style name="HomeSettings.SwitchPreferenceStyle"
parent="@style/Preference.SwitchPreference.Material">
<item name="iconSpaceReserved">@bool/home_settings_icon_space_reserved</item>
</style>
<style name="HomeSettings.SwitchStyle"
parent="@android:style/Widget.Material.CompoundButton.Switch">
<item name="android:switchMinWidth">52dp</item>
<item name="android:thumb">@drawable/home_settings_switch_thumb</item>
<item name="android:track">@drawable/home_settings_switch_track</item>
</style>
<style name="HomeSettings.PreferenceTitle"
parent="@android:style/TextAppearance.Material.Subhead">
<item name="android:fontFamily">google-sans</item>
<item name="android:textSize">20sp</item>
</style>
<style name="HomeSettings.CategoryTitle" parent="@android:style/TextAppearance.Material.Body2">
<item name="android:fontFamily">google-sans-text-medium</item>
</style>
<style name="HomeSettings.CollapsingToolbar" parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorAccent">@color/home_settings_header_accent</item>
<item name="colorPrimary">@color/home_settings_header_expanded</item>
<item name="elevationOverlayColor">?attr/colorPrimary</item>
<item name="elevationOverlayEnabled">true</item>
</style>
<style name="HomeSettings.CollapsedToolbarTitle"
parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
<item name="android:fontFamily">google-sans</item>
</style>
<style name="HomeSettings.ExpandedToolbarTitle" parent="HomeSettings.CollapsedToolbarTitle">
<item name="android:textSize">36sp</item>
</style>
</resources>
+5 -5
View File
@@ -154,18 +154,18 @@
<style name="AppTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark.DarkMainColor" />
<style name="AppTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark.DarkText" />
<style name="HomeSettings.Theme" parent="@android:style/Theme.DeviceDefault.Settings">
<style name="HomeSettingsTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:navigationBarColor">?android:colorPrimaryDark</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="preferenceTheme">@style/HomeSettings.PreferenceTheme</item>
<item name="preferenceTheme">@style/HomeSettingsPreferenceTheme</item>
</style>
<style name="HomeSettings.PreferenceTheme" parent="@style/PreferenceThemeOverlay.v14.Material">
<item name="preferenceFragmentCompatStyle">@style/HomeSettings.FragmentCompatStyle</item>
<style name="HomeSettingsPreferenceTheme" parent="@style/PreferenceThemeOverlay.v14.Material">
<item name="preferenceFragmentCompatStyle">@style/HomeSettingsFragmentCompatStyle</item>
</style>
<style name="HomeSettings.FragmentCompatStyle" parent="@style/PreferenceFragment.Material">
<style name="HomeSettingsFragmentCompatStyle" parent="@style/PreferenceFragment.Material">
<item name="android:layout">@layout/home_settings</item>
</style>