From df13f242d3a8fdb5a224706fb01d425e8106cecd Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Thu, 8 Mar 2018 21:40:05 -0800 Subject: [PATCH] Make links focusableInTouchMode for platform variant ag/3692611, but for platform variant Test: ./gradlew testPlatformDeprecatedDebugUnitTest Bug: 73350031 Change-Id: Ibd27348d97b9884be38eff69b540aedaf6416a2c (cherry picked from commit a164eae405e822157f07b050982640d5c457f9aa) --- .../src/com/android/setupwizardlib/view/RichTextView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/platform/src/com/android/setupwizardlib/view/RichTextView.java b/library/platform/src/com/android/setupwizardlib/view/RichTextView.java index 5a78561..aab3238 100644 --- a/library/platform/src/com/android/setupwizardlib/view/RichTextView.java +++ b/library/platform/src/com/android/setupwizardlib/view/RichTextView.java @@ -121,6 +121,11 @@ public class RichTextView extends TextView implements OnLinkClickListener { // as individual TextViews consume touch events and thereby reducing the focus window // shown by Talkback. Disable focus if there are no links setFocusable(hasLinks); + // Do not "reveal" (i.e. scroll to) this view when this view is focused. Since this view is + // focusable in touch mode, we may be focused when the screen is first shown, and starting + // a screen halfway scrolled down is confusing to the user. + setRevealOnFocusHint(false); + setFocusableInTouchMode(hasLinks); } private boolean hasLinks(CharSequence text) {