From e708048beda4912fb90d31b9a3f0fadc0d6e2d08 Mon Sep 17 00:00:00 2001 From: Tsung-Mao Fang Date: Fri, 18 Mar 2022 18:51:50 +0800 Subject: [PATCH] Fix can't focus on learn more link. Prior to this cl, we set learn more text not focusable, it causes a11y services can't distinguish it as an action item. Also do some clean up, because we only allow clean plain text for title id, so we can simply make it as Also, we make footer preference can't be selectable, so it can group subcomponents to make more accessible. Test: Verify on battery saver / a11y related page with talkback service , switch access, voice access. Fix: 216516546 FIx: 215478454 Fix: 215476405 Fix: 215484382 Fix: 215483374 Change-Id: I15e82f871107115650c347aa32db5fb29ee446f7 --- .../res/layout-v31/preference_footer.xml | 2 +- .../res/layout/preference_footer.xml | 2 +- .../settingslib/widget/FooterPreference.java | 7 +--- .../res/layout/preference_footer.xml | 36 +++++++++++++------ .../widget/FooterPreferenceTest.java | 12 ------- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml b/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml index b1276303b801..212ae528a6b9 100644 --- a/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml +++ b/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml @@ -46,7 +46,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> - - + android:layout_height="wrap_content"/> - + android:orientation="vertical"> + + + + diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java index 3b18c57e28fa..61a28aab061f 100644 --- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java +++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java @@ -19,7 +19,6 @@ package com.android.settingslib.widget; import static com.google.common.truth.Truth.assertThat; import android.content.Context; -import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.widget.TextView; @@ -45,17 +44,6 @@ public class FooterPreferenceTest { mFooterPreference = new FooterPreference(mContext); } - @Test - public void bindPreference_shouldLinkifyContent() { - final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests( - LayoutInflater.from(mContext).inflate(R.layout.preference_footer, null)); - - mFooterPreference.onBindViewHolder(holder); - - assertThat(((TextView) holder.findViewById(android.R.id.title)).getMovementMethod()) - .isInstanceOf(LinkMovementMethod.class); - } - @Test public void setSummary_summarySet_shouldSetAsTitle() { mFooterPreference.setSummary("summary");