Merge "Update battery help message layout" into sc-dev am: 0df7148f1e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14424446

Change-Id: I7528851174559ee89540b5dfe9b58e68669211d8
This commit is contained in:
Wesley Wang
2021-05-04 18:08:20 +00:00
committed by Automerger Merge Worker
3 changed files with 40 additions and 20 deletions

View File

@@ -4205,4 +4205,20 @@
column="5"/> column="5"/>
</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.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;color name=&quot;battery_info_error_color_red&quot;>#fce8e6&lt;/color> &lt;!-- Material Red 50 -->"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/values/colors.xml"
line="202"
column="5"/>
</issue>
</issues> </issues>

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
~ Copyright (C) 2021 The Android Open Source Project Copyright (C) 2021 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and See the License for the specific language governing permissions and
~ limitations under the License. limitations under the License.
--> -->
<!-- TODO(b/179237551): Refine the layout once the design been lock down. -->
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -23,26 +23,28 @@
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:layout_margin="8dp"
android:layout_marginEnd="24dp"
style="@style/ContextualCardStyle"> style="@style/ContextualCardStyle">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="top|start" android:gravity="top|start"
android:orientation="vertical" android:orientation="vertical"
android:padding="16dp" android:padding="20dp"
android:background="@color/homepage_emergency_background"> android:background="@color/battery_info_error_color_red">
<ImageView <ImageView
android:id="@+id/battery_icon" android:id="@+id/battery_icon"
android:src="@drawable/ic_battery_alert_24dp" android:src="@drawable/ic_warning_24dp"
android:tint="@*android:color/material_red_A700"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView android:id="@+id/summary_text" <TextView android:id="@+id/summary_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="16dp"
android:text="@string/battery_missing_message" android:text="@string/battery_missing_message"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary" /> android:textColor="?android:attr/textColorSecondary" />
@@ -53,7 +55,7 @@
android:layout_gravity="end" android:layout_gravity="end"
android:text="@string/battery_missing_link_message" android:text="@string/battery_missing_link_message"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/colorError" /> android:textColor="@*android:color/material_red_A700" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</FrameLayout> </FrameLayout>

View File

@@ -198,4 +198,6 @@
<color name="accessibility_magnification_background">#F50D60</color> <color name="accessibility_magnification_background">#F50D60</color>
<color name="accessibility_daltonizer_background">#00BCD4</color> <color name="accessibility_daltonizer_background">#00BCD4</color>
<color name="accessibility_color_inversion_background">#546E7A</color> <color name="accessibility_color_inversion_background">#546E7A</color>
<color name="battery_info_error_color_red">#fce8e6</color> <!-- Material Red 50 -->
</resources> </resources>