Redesign homepage IA icon
- remove the outer circle of the icons
- tint the icons including injected ones
Test: robotest, visual
Bug: 182870640
Change-Id: If72c37152f4f0d68e25149b11d497eef1c7ece91
diff --git a/res/drawable/ic_homepage_about_v2.xml b/res/drawable/ic_homepage_about_v2.xml
deleted file mode 100644
index c069bfc..0000000
--- a/res/drawable/ic_homepage_about_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_about_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_phone_info" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_accessibility_v2.xml b/res/drawable/ic_homepage_accessibility_v2.xml
deleted file mode 100644
index 24ca8cf..0000000
--- a/res/drawable/ic_homepage_accessibility_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_accessibility_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_accessibility" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_accounts_v2.xml b/res/drawable/ic_homepage_accounts_v2.xml
deleted file mode 100644
index 6ea981f..0000000
--- a/res/drawable/ic_homepage_accounts_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_accounts_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_accounts" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_apps_v2.xml b/res/drawable/ic_homepage_apps_v2.xml
deleted file mode 100644
index c6ac0c4..0000000
--- a/res/drawable/ic_homepage_apps_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_app_and_notification_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_apps" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_battery_v2.xml b/res/drawable/ic_homepage_battery_v2.xml
deleted file mode 100644
index 680031f..0000000
--- a/res/drawable/ic_homepage_battery_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_battery_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_battery_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_connected_device_v2.xml b/res/drawable/ic_homepage_connected_device_v2.xml
deleted file mode 100644
index f3e95d2..0000000
--- a/res/drawable/ic_homepage_connected_device_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_connected_device_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_devices_other" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_display_v2.xml b/res/drawable/ic_homepage_display_v2.xml
deleted file mode 100644
index e4014ee..0000000
--- a/res/drawable/ic_homepage_display_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_display_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_display_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_emergency_v2.xml b/res/drawable/ic_homepage_emergency_v2.xml
deleted file mode 100644
index 86d1470..0000000
--- a/res/drawable/ic_homepage_emergency_v2.xml
+++ /dev/null
@@ -1,33 +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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_emergency_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_emergency" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_location_v2.xml b/res/drawable/ic_homepage_location_v2.xml
deleted file mode 100644
index 5dc72eb..0000000
--- a/res/drawable/ic_homepage_location_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_location_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_location"/>
-</layer-list>
diff --git a/res/drawable/ic_homepage_network_v2.xml b/res/drawable/ic_homepage_network_v2.xml
deleted file mode 100644
index d3b33e9..0000000
--- a/res/drawable/ic_homepage_network_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_network_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_wireless_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_notification_v2.xml b/res/drawable/ic_homepage_notification_v2.xml
deleted file mode 100644
index 3883cfb..0000000
--- a/res/drawable/ic_homepage_notification_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_notification_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_notifications_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_privacy_v2.xml b/res/drawable/ic_homepage_privacy_v2.xml
deleted file mode 100644
index 56e6da8..0000000
--- a/res/drawable/ic_homepage_privacy_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_privacy_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_privacy"/>
-</layer-list>
diff --git a/res/drawable/ic_homepage_security_v2.xml b/res/drawable/ic_homepage_security_v2.xml
deleted file mode 100644
index 5e33add..0000000
--- a/res/drawable/ic_homepage_security_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_security_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_security_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_sound_v2.xml b/res/drawable/ic_homepage_sound_v2.xml
deleted file mode 100644
index 8561820..0000000
--- a/res/drawable/ic_homepage_sound_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_sound_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_volume_up_24dp" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_storage_v2.xml b/res/drawable/ic_homepage_storage_v2.xml
deleted file mode 100644
index 1a8b7d2..0000000
--- a/res/drawable/ic_homepage_storage_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_storage_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_storage_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_support_v2.xml b/res/drawable/ic_homepage_support_v2.xml
deleted file mode 100644
index 8139973..0000000
--- a/res/drawable/ic_homepage_support_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_support_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_help" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_system_dashboard_v2.xml b/res/drawable/ic_homepage_system_dashboard_v2.xml
deleted file mode 100644
index 7c016a2..0000000
--- a/res/drawable/ic_homepage_system_dashboard_v2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2018 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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_system_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_system_dashboard_white" />
-</layer-list>
diff --git a/res/drawable/ic_homepage_wallpaper_v2.xml b/res/drawable/ic_homepage_wallpaper_v2.xml
deleted file mode 100644
index ee16339..0000000
--- a/res/drawable/ic_homepage_wallpaper_v2.xml
+++ /dev/null
@@ -1,33 +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>
- <com.android.settingslib.widget.AdaptiveIconShapeDrawable
- android:width="@dimen/homepage_image_size"
- android:height="@dimen/homepage_image_size"
- android:color="@color/homepage_wallpaper_background" />
- </item>
-
- <item
- android:width="@dimen/dashboard_tile_foreground_image_size"
- android:height="@dimen/dashboard_tile_foreground_image_size"
- android:start="@dimen/homepage_foreground_image_inset"
- android:top="@dimen/homepage_foreground_image_inset"
- android:drawable="@drawable/ic_settings_wallpaper_white" />
-</layer-list>
diff --git a/res/layout/homepage_preference.xml b/res/layout/homepage_preference.xml
deleted file mode 100644
index 480340a..0000000
--- a/res/layout/homepage_preference.xml
+++ /dev/null
@@ -1,75 +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.
- -->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="72dp"
- android:gravity="center_vertical"
- android:paddingStart="24dp"
- android:paddingEnd="24dp"
- android:background="?android:attr/selectableItemBackground"
- android:clipToPadding="false"
- android:baselineAligned="false">
-
- <LinearLayout
- android:id="@+id/icon_frame"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="start|center_vertical"
- android:orientation="horizontal"
- android:paddingTop="4dp"
- android:paddingBottom="4dp"
- android:layout_marginEnd="16dp">
-
- <androidx.preference.internal.PreferenceImageView
- android:id="@android:id/icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:maxWidth="48dp"
- app:maxHeight="48dp"/>
-
- </LinearLayout>
-
- <RelativeLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingTop="16dp"
- android:paddingBottom="16dp">
-
- <TextView
- android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="@style/TextAppearance.HomepagePreferenceTitle"
- android:ellipsize="marquee"/>
-
- <TextView android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignStart="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="4"/>
- </RelativeLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 076ab04..6197282 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -118,12 +118,6 @@
<!-- Dashboard foreground image inset (from background edge to foreground edge) -->
<dimen name="dashboard_tile_foreground_image_inset">6dp</dimen>
- <!-- Homepage image tile size -->
- <dimen name="homepage_image_size">48dp</dimen>
-
- <!-- Homepage foreground image inset (from background edge to foreground edge) -->
- <dimen name="homepage_foreground_image_inset">12dp</dimen>
-
<!-- Preference icon foreground image inset (from background edge to foreground edge) -->
<dimen name="preference_icon_foreground_image_inset">12dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index b7a6dab..e8670f9 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -315,12 +315,6 @@
<item name="android:singleLine">true</item>
</style>
- <style name="TextAppearance.HomepagePreferenceTitle"
- parent="@*android:style/TextAppearance.DeviceDefault">
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textSize">20sp</item>
- </style>
-
<style name="TextAppearance.HomepageCardTitle"
parent="@*android:style/TextAppearance.DeviceDefault.Subhead">
<item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
diff --git a/res/xml/top_level_settings_grouped.xml b/res/xml/top_level_settings_grouped.xml
index 2b29940..6c03380 100644
--- a/res/xml/top_level_settings_grouped.xml
+++ b/res/xml/top_level_settings_grouped.xml
@@ -20,154 +20,154 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="top_level_settings_grouped">
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.network.NetworkDashboardFragment"
- android:icon="@drawable/ic_homepage_network_v2"
+ android:icon="@drawable/ic_settings_wireless"
android:key="top_level_network"
android:order="-150"
android:title="@string/network_dashboard_title"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.network.TopLevelNetworkEntryPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment"
- android:icon="@drawable/ic_homepage_connected_device_v2"
+ android:icon="@drawable/ic_devices_other"
android:key="top_level_connected_devices"
android:order="-140"
android:title="@string/connected_devices_dashboard_title"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.connecteddevice.TopLevelConnectedDevicesPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.applications.AppDashboardFragment"
- android:icon="@drawable/ic_homepage_apps_v2"
+ android:icon="@drawable/ic_apps"
android:key="top_level_apps"
android:order="-130"
android:title="@string/apps_dashboard_title"
android:summary="@string/app_and_notification_dashboard_summary"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.notification.ConfigureNotificationSettings"
- android:icon="@drawable/ic_homepage_notification_v2"
+ android:icon="@drawable/ic_notifications"
android:key="top_level_notification"
android:order="-120"
android:title="@string/configure_notification_settings"
android:summary="@string/notification_dashboard_summary"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.fuelgauge.PowerUsageSummary"
- android:icon="@drawable/ic_homepage_battery_v2"
+ android:icon="@drawable/ic_settings_battery_white"
android:key="top_level_battery"
android:order="-110"
android:title="@string/power_usage_summary_title"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.fuelgauge.TopLevelBatteryPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.deviceinfo.StorageDashboardFragment"
- android:icon="@drawable/ic_homepage_storage_v2"
+ android:icon="@drawable/ic_storage_white"
android:key="top_level_storage"
android:order="-100"
android:title="@string/storage_settings"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.deviceinfo.TopLevelStoragePreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.notification.SoundSettings"
- android:icon="@drawable/ic_homepage_sound_v2"
+ android:icon="@drawable/ic_volume_up_24dp"
android:key="top_level_sound"
android:order="-90"
android:title="@string/sound_settings"
android:summary="@string/sound_dashboard_summary"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.DisplaySettings"
- android:icon="@drawable/ic_homepage_display_v2"
+ android:icon="@drawable/ic_settings_display_white"
android:key="top_level_display"
android:order="-80"
android:title="@string/display_settings"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.display.TopLevelDisplayPreferenceController"/>
- <com.android.settings.homepage.RestrictedHomepagePreference
- android:icon="@drawable/ic_homepage_wallpaper_v2"
+ <com.android.settingslib.RestrictedTopLevelPreference
+ android:icon="@drawable/ic_settings_wallpaper_white"
android:key="top_level_wallpaper"
android:order="-70"
android:title="@string/wallpaper_settings_title"
android:summary="@string/wallpaper_dashboard_summary"
settings:controller="com.android.settings.display.TopLevelWallpaperPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.accessibility.AccessibilitySettings"
- android:icon="@drawable/ic_homepage_accessibility_v2"
+ android:icon="@drawable/ic_settings_accessibility"
android:key="top_level_accessibility"
android:order="-60"
android:title="@string/accessibility_settings"
android:summary="@string/accessibility_settings_summary"
settings:controller="com.android.settings.accessibility.TopLevelAccessibilityPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.security.SecuritySettings"
- android:icon="@drawable/ic_homepage_security_v2"
+ android:icon="@drawable/ic_settings_security_white"
android:key="top_level_security"
android:order="-50"
android:title="@string/security_settings_title"
android:summary="@string/security_dashboard_summary_biometric"
settings:controller="com.android.settings.security.TopLevelSecurityEntryPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.privacy.PrivacyDashboardFragment"
- android:icon="@drawable/ic_homepage_privacy_v2"
+ android:icon="@drawable/ic_settings_privacy"
android:key="top_level_privacy"
android:order="-40"
android:title="@string/privacy_dashboard_title"
android:summary="@string/privacy_dashboard_summary"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.location.LocationSettings"
- android:icon="@drawable/ic_homepage_location_v2"
+ android:icon="@drawable/ic_settings_location"
android:key="top_level_location"
android:order="-30"
android:title="@string/location_settings_title"
android:summary="@string/location_settings_loading_app_permission_stats"
settings:controller="com.android.settings.location.TopLevelLocationPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:key="top_level_emergency"
android:title="@string/emergency_settings_preference_title"
android:summary="@string/emergency_dashboard_summary"
- android:icon="@drawable/ic_homepage_emergency_v2"
+ android:icon="@drawable/ic_settings_emergency"
android:order="-20"
android:fragment="com.android.settings.emergency.EmergencyDashboardFragment"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.accounts.AccountDashboardFragment"
- android:icon="@drawable/ic_homepage_accounts_v2"
+ android:icon="@drawable/ic_settings_accounts"
android:key="top_level_accounts"
android:order="-10"
android:title="@string/account_dashboard_title"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.accounts.TopLevelAccountEntryPreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.system.SystemDashboardFragment"
- android:icon="@drawable/ic_homepage_system_dashboard_v2"
+ android:icon="@drawable/ic_settings_system_dashboard_white"
android:key="top_level_system"
android:order="10"
android:title="@string/header_category_system"
android:summary="@string/system_dashboard_summary"/>
- <com.android.settings.homepage.HomepagePreference
+ <Preference
android:fragment="com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment"
- android:icon="@drawable/ic_homepage_about_v2"
+ android:icon="@drawable/ic_phone_info"
android:key="top_level_about_device"
android:order="20"
android:title="@string/about_settings"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.deviceinfo.aboutphone.TopLevelAboutDevicePreferenceController"/>
- <com.android.settings.homepage.HomepagePreference
- android:icon="@drawable/ic_homepage_support_v2"
+ <Preference
+ android:icon="@drawable/ic_help"
android:key="top_level_support"
android:order="100"
android:title="@string/page_tab_title_support"
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 7614070..4287810 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -1211,6 +1211,14 @@
return roundedBitmap;
}
+ /**
+ * Returns the color of homepage preference icons.
+ */
+ @ColorInt
+ public static int getHomepageIconColor(Context context) {
+ return getColorAttrDefaultColor(context, android.R.attr.textColorPrimary);
+ }
+
public static boolean isProviderModelEnabled(Context context) {
return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL);
}
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 254a6a7..b404ecc 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -59,6 +59,7 @@
import com.android.settings.R;
import com.android.settings.SettingsActivity;
+import com.android.settings.Utils;
import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.profileselector.ProfileSelectDialog;
import com.android.settings.overlay.FeatureFactory;
@@ -401,12 +402,12 @@
private void setPreferenceIcon(Preference preference, Tile tile, boolean forceRoundedIcon,
String iconPackage, Icon icon) {
Drawable iconDrawable = icon.loadDrawable(preference.getContext());
- if (forceRoundedIcon && !TextUtils.equals(mContext.getPackageName(), iconPackage)) {
+ if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)
+ && TextUtils.equals(tile.getCategory(), CategoryKey.CATEGORY_HOMEPAGE)) {
+ iconDrawable.setTint(Utils.getHomepageIconColor(preference.getContext()));
+ } else if (forceRoundedIcon && !TextUtils.equals(mContext.getPackageName(), iconPackage)) {
iconDrawable = new AdaptiveIcon(mContext, iconDrawable,
- FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)
- && TextUtils.equals(tile.getCategory(), CategoryKey.CATEGORY_HOMEPAGE)
- ? R.dimen.homepage_foreground_image_inset
- : R.dimen.dashboard_tile_foreground_image_inset);
+ R.dimen.dashboard_tile_foreground_image_inset);
((AdaptiveIcon) iconDrawable).setBackgroundColor(mContext, tile);
}
preference.setIcon(iconDrawable);
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index 1b2be80..e0c9820 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -39,13 +39,11 @@
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerListHelper;
import com.android.settings.core.SettingsBaseActivity;
-import com.android.settings.homepage.HomepagePreference;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.PrimarySwitchPreference;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
-import com.android.settingslib.drawer.CategoryKey;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.ProviderTile;
import com.android.settingslib.drawer.Tile;
@@ -538,10 +536,6 @@
@VisibleForTesting
Preference createPreference(Tile tile) {
- if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)
- && TextUtils.equals(tile.getCategory(), CategoryKey.CATEGORY_HOMEPAGE)) {
- return new HomepagePreference(getPrefContext());
- }
return tile instanceof ProviderTile
? new SwitchPreference(getPrefContext())
: tile.hasSwitch()
diff --git a/src/com/android/settings/display/TopLevelWallpaperPreferenceController.java b/src/com/android/settings/display/TopLevelWallpaperPreferenceController.java
index 7b3d788..c84a15e 100644
--- a/src/com/android/settings/display/TopLevelWallpaperPreferenceController.java
+++ b/src/com/android/settings/display/TopLevelWallpaperPreferenceController.java
@@ -25,7 +25,6 @@
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
import android.text.TextUtils;
-import android.util.FeatureFlagUtils;
import android.util.Log;
import androidx.preference.Preference;
@@ -33,8 +32,6 @@
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
-import com.android.settings.core.FeatureFlags;
-import com.android.settings.homepage.RestrictedHomepagePreference;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.RestrictedTopLevelPreference;
@@ -92,11 +89,7 @@
@Override
public void updateState(Preference preference) {
- if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
- disablePreferenceIfManaged((RestrictedHomepagePreference) preference);
- } else {
- disablePreferenceIfManaged((RestrictedTopLevelPreference) preference);
- }
+ disablePreferenceIfManaged((RestrictedTopLevelPreference) preference);
}
@Override
@@ -140,18 +133,4 @@
}
}
}
-
- private void disablePreferenceIfManaged(RestrictedHomepagePreference pref) {
- final String restriction = DISALLOW_SET_WALLPAPER;
- if (pref != null) {
- pref.setDisabledByAdmin(null);
- if (RestrictedLockUtilsInternal.hasBaseUserRestriction(mContext,
- restriction, UserHandle.myUserId())) {
- // Do not show the admin dialog for system restriction.
- pref.setEnabled(false);
- } else {
- pref.checkRestrictionAndSetDisabled(restriction);
- }
- }
- }
}
diff --git a/src/com/android/settings/homepage/HomepagePreference.java b/src/com/android/settings/homepage/HomepagePreference.java
deleted file mode 100644
index 6086b9f..0000000
--- a/src/com/android/settings/homepage/HomepagePreference.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.homepage;
-
-import android.content.Context;
-import android.util.AttributeSet;
-
-import androidx.preference.Preference;
-
-import com.android.settings.R;
-
-/** A customized layout for homepage preference. */
-public class HomepagePreference extends Preference {
-
- public HomepagePreference(Context context) {
- super(context);
- setLayoutResource(R.layout.homepage_preference);
- }
-
- public HomepagePreference(Context context, AttributeSet attrs) {
- super(context, attrs);
- setLayoutResource(R.layout.homepage_preference);
- }
-
- public HomepagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, /* defStyleRes= */ 0);
- setLayoutResource(R.layout.homepage_preference);
- }
-
- public HomepagePreference(Context context, AttributeSet attrs,
- int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- setLayoutResource(R.layout.homepage_preference);
- }
-}
diff --git a/src/com/android/settings/homepage/RestrictedHomepagePreference.java b/src/com/android/settings/homepage/RestrictedHomepagePreference.java
deleted file mode 100644
index 476642d..0000000
--- a/src/com/android/settings/homepage/RestrictedHomepagePreference.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.homepage;
-
-import android.content.Context;
-import android.util.AttributeSet;
-
-import androidx.core.content.res.TypedArrayUtils;
-
-import com.android.settings.R;
-import com.android.settingslib.RestrictedTopLevelPreference;
-
-/** Homepage preference that can be disabled by a device admin using a user restriction. */
-public class RestrictedHomepagePreference extends RestrictedTopLevelPreference {
-
- public RestrictedHomepagePreference(Context context, AttributeSet attrs,
- int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- setLayoutResource(R.layout.homepage_preference);
- }
-
- public RestrictedHomepagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, /* defStyleRes= */ 0);
- }
-
- public RestrictedHomepagePreference(Context context, AttributeSet attrs) {
- this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
- android.R.attr.preferenceStyle));
- }
-
- public RestrictedHomepagePreference(Context context) {
- this(context, /* attrs= */ null);
- }
-}
diff --git a/src/com/android/settings/homepage/TopLevelSettings.java b/src/com/android/settings/homepage/TopLevelSettings.java
index 47a46f2..f4f7f61 100644
--- a/src/com/android/settings/homepage/TopLevelSettings.java
+++ b/src/com/android/settings/homepage/TopLevelSettings.java
@@ -21,6 +21,7 @@
import android.app.settings.SettingsEnums;
import android.content.Context;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.util.FeatureFlagUtils;
@@ -28,8 +29,10 @@
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceScreen;
import com.android.settings.R;
+import com.android.settings.Utils;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
@@ -103,6 +106,31 @@
}
@Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+ super.onCreatePreferences(savedInstanceState, rootKey);
+ if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
+ return;
+ }
+ final PreferenceScreen screen = getPreferenceScreen();
+ if (screen == null) {
+ return;
+ }
+ // Tint the homepage icons
+ final int tintColor = Utils.getHomepageIconColor(getContext());
+ final int count = screen.getPreferenceCount();
+ for (int i = 0; i < count; i++) {
+ final Preference preference = screen.getPreference(i);
+ if (preference == null) {
+ break;
+ }
+ final Drawable icon = preference.getIcon();
+ if (icon != null) {
+ icon.setTint(tintColor);
+ }
+ }
+ }
+
+ @Override
protected boolean shouldForceRoundedIcon() {
return getContext().getResources()
.getBoolean(R.bool.config_force_rounded_icon_TopLevelSettings);
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
index 9d7d746..b83e487 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
@@ -48,7 +48,6 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settings.homepage.HomepagePreference;
import com.android.settings.slices.BlockingSlicePrefController;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.widget.PrimarySwitchPreference;
@@ -56,7 +55,6 @@
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
import com.android.settingslib.drawer.ActivityTile;
-import com.android.settingslib.drawer.CategoryKey;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.ProviderTile;
@@ -338,16 +336,6 @@
}
@Test
- public void createPreference_isHomepageTile_returnHomepagePreference() {
- FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, true);
- mActivityTile.setCategory(CategoryKey.CATEGORY_HOMEPAGE);
-
- final Preference pref = mTestFragment.createPreference(mActivityTile);
-
- assertThat(pref).isInstanceOf(HomepagePreference.class);
- }
-
- @Test
public void isFeatureFlagAndIsParalleled_runParalleledUpdatePreferenceStates() {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.CONTROLLER_ENHANCEMENT, true);
final TestFragment testFragment = spy(new TestFragment(RuntimeEnvironment.application));
@@ -472,7 +460,7 @@
return mIsParalleled;
}
- public void setUsingControllerEnhancement(boolean isParalleled) {
+ void setUsingControllerEnhancement(boolean isParalleled) {
mIsParalleled = isParalleled;
}
}
diff --git a/tests/robotests/src/com/android/settings/homepage/TopLevelSettingsTest.java b/tests/robotests/src/com/android/settings/homepage/TopLevelSettingsTest.java
index 0cc6b43..663d7f7 100644
--- a/tests/robotests/src/com/android/settings/homepage/TopLevelSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/TopLevelSettingsTest.java
@@ -18,14 +18,24 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.nullable;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
import android.util.FeatureFlagUtils;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
+import com.android.settings.testutils.FakeFeatureFactory;
import org.junit.Before;
import org.junit.Test;
@@ -43,6 +53,11 @@
mContext = RuntimeEnvironment.application;
mSettings = spy(new TopLevelSettings());
when(mSettings.getContext()).thenReturn(mContext);
+ final FakeFeatureFactory featureFactory = FakeFeatureFactory.setupForTest();
+ when(featureFactory.dashboardFeatureProvider
+ .getTilesForCategory(nullable(String.class)))
+ .thenReturn(null);
+ mSettings.onAttach(mContext);
}
@Test
@@ -62,4 +77,21 @@
assertThat(mSettings.getPreferenceScreenResId()).isEqualTo(
R.xml.top_level_settings_grouped);
}
+
+ @Test
+ public void onCreatePreferences_shouldTintPreferenceIcon() {
+ final Preference preference = new Preference(mContext);
+ preference.setTitle(R.string.network_dashboard_title);
+ final Drawable icon = spy(mContext.getDrawable(R.drawable.ic_settings_wireless));
+ preference.setIcon(icon);
+ final PreferenceScreen screen = spy(new PreferenceScreen(mContext, null /* attrs */));
+ doReturn(1).when(screen).getPreferenceCount();
+ doReturn(preference).when(screen).getPreference(anyInt());
+ doReturn(screen).when(mSettings).getPreferenceScreen();
+ doReturn(0).when(mSettings).getPreferenceScreenResId();
+
+ mSettings.onCreatePreferences(new Bundle(), "rootKey");
+
+ verify(icon).setTint(anyInt());
+ }
}