Make links focusableInTouchMode for platform variant

ag/3692611, but for platform variant

Test: ./gradlew testPlatformDeprecatedDebugUnitTest
Bug: 73350031
Change-Id: Ibd27348d97b9884be38eff69b540aedaf6416a2c
(cherry picked from commit a164eae405)
This commit is contained in:
Maurice Lam 2018-03-08 21:40:05 -08:00
parent 3aaaf23043
commit df13f242d3

View file

@ -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) {