I am trying to improve accessibility for a text view used for terms and privacy policy which looks something like this:
As mentioned on the Google Support page, the user will need to access the Local Context Menu
via a TalkBack
gesture (default gesture is Swipe up then right) to activate a TextView link.
But I want to use a swipe gesture to navigate between links something like:
Currently, I am using clickable span to add the links, it is working fine with Local Context Menu
but not with a swipe gesture.
My code looks something like this:
val clickableSpan: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
// handle link click.
}
}
val spannableStringBuilder = SpannableStringBuilder(text).apply {
setSpan(clickableSpan, 99, 109, Spannable.SPAN_INCLUSIVE_INCLUSIVE)
}
tv_term_and_privacy_policy.apply {
setText(spannableStringBuilder)
movementMethod = LinkMovementMethod.getInstance()
}
Please help me with this.