summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2018-03-08 21:40:05 -0800
committerMaurice Lam <yukl@google.com>2018-03-12 19:24:23 +0000
commitdf13f242d3a8fdb5a224706fb01d425e8106cecd (patch)
treeb9cb964f3109562bccdc78a905ff06c6205e781d
parent3aaaf2304300af82da44df0379d2c20cfab8a32f (diff)
downloadsetupwizard-df13f242d3a8fdb5a224706fb01d425e8106cecd.tar.gz
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)
-rw-r--r--library/platform/src/com/android/setupwizardlib/view/RichTextView.java5
1 files changed, 5 insertions, 0 deletions
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) {