Update battery error layout
- Update font
- Add importantForAccessibility to make whole layout selectable
Screenshot: https://screenshot.googleplex.com/9nJxzD47xeaB6ea.png
Bug: 187612897
Test: make RunSettingsRoboTests
Change-Id: I15bbee6780d8e2c0a01995c6dbb91b933abda274
diff --git a/res/layout/preference_battery_error.xml b/res/layout/preference_battery_error.xml
index 4efd13a..68ac6a2 100644
--- a/res/layout/preference_battery_error.xml
+++ b/res/layout/preference_battery_error.xml
@@ -24,6 +24,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
+ android:importantForAccessibility="yes"
style="@style/ContextualCardStyle">
<LinearLayout
android:layout_width="match_parent"
@@ -46,16 +47,16 @@
android:layout_marginTop="12dp"
android:layout_marginBottom="16dp"
android:text="@string/battery_missing_message"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary" />
+ android:textAppearance="?android:attr/textAppearanceListItem" />
<TextView android:id="@+id/link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/battery_missing_link_message"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@*android:color/material_red_A700" />
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+ android:textColor="@*android:color/material_red_A700"
+ android:contentDescription="@string/battery_missing_link_a11y_message" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c6ea2d2..7e1420a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6204,6 +6204,8 @@
<string name="battery_missing_message">Can’t update battery info</string>
<!-- Help text if battery is not present. [CHAR LIMIT=NONE] -->
<string name="battery_missing_link_message"></string>
+ <!-- Accessibility description for battery missing link. [CHAR LIMIT=NONE] -->
+ <string name="battery_missing_link_a11y_message">Tap to learn more about this error</string>
<!-- Title for force stop dialog [CHAR LIMIT=30] -->
<string name="dialog_stop_title">Stop app?</string>