Fix empty icon while tapping Auto-rotate screen widget
- Use the layer-list and AdaptiveIconShapeDrawable to include ic_screen_rotation_24dp. - Update the color-check-baseline.xml. Fixes: 277309043 Test: manual test Change-Id: Ie1e3e114bb274c819902e1f5ff87240128afcba5
This commit is contained in:
@@ -1358,7 +1358,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="Settings$SmartAutoRotateSettingsActivity"
|
android:name="Settings$SmartAutoRotateSettingsActivity"
|
||||||
android:label="@string/accelerometer_title"
|
android:label="@string/accelerometer_title"
|
||||||
android:icon="@drawable/ic_screen_rotation_24dp"
|
android:icon="@drawable/ic_screen_rotation"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1">
|
<intent-filter android:priority="1">
|
||||||
<action android:name="android.settings.AUTO_ROTATE_SETTINGS" />
|
<action android:name="android.settings.AUTO_ROTATE_SETTINGS" />
|
||||||
|
@@ -4429,6 +4429,22 @@
|
|||||||
column="13"/>
|
column="13"/>
|
||||||
</issue>
|
</issue>
|
||||||
|
|
||||||
|
<issue
|
||||||
|
id="HardCodedColor"
|
||||||
|
severity="Error"
|
||||||
|
message="Avoid using hardcoded color"
|
||||||
|
category="Correctness"
|
||||||
|
priority="4"
|
||||||
|
summary="Using hardcoded color"
|
||||||
|
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.
This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
|
||||||
|
errorLine1=" android:color="@color/homepage_display_background" />"
|
||||||
|
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||||
|
<location
|
||||||
|
file="res/drawable/ic_screen_rotation.xml"
|
||||||
|
line="24"
|
||||||
|
column="13"/>
|
||||||
|
</issue>
|
||||||
|
|
||||||
<issue
|
<issue
|
||||||
id="HardCodedColor"
|
id="HardCodedColor"
|
||||||
severity="Error"
|
severity="Error"
|
||||||
|
33
res/drawable/ic_screen_rotation.xml
Normal file
33
res/drawable/ic_screen_rotation.xml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
|
||||||
|
android:width="@dimen/dashboard_tile_image_size"
|
||||||
|
android:height="@dimen/dashboard_tile_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/dashboard_tile_foreground_image_inset"
|
||||||
|
android:top="@dimen/dashboard_tile_foreground_image_inset"
|
||||||
|
android:drawable="@drawable/ic_screen_rotation_24dp" />
|
||||||
|
</layer-list>
|
Reference in New Issue
Block a user