Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String is read as number rather than reading it digit by digit when talk back is on in android

I have a string "9039662543", and when talk back is on, this string is read as "nine million...." in 4.3 android devices, above 4.3 devices its working fine, by reading "nine zero three...". What should I do to fix this?

like image 978
AnanduKrishnan P.S. Avatar asked Feb 11 '16 07:02

AnanduKrishnan P.S.


1 Answers

For EditText, add a space between characters and set this text in Accessibility Node Info.

ViewCompat.setAccessibilityDelegate(editText,object : AccessibilityDelegateCompat(){
    override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfoCompat) {
        super.onInitializeAccessibilityNodeInfo(host, info)
        info.text = editText.text.toString().replace(".".toRegex(),"$0 ")
    }
})
like image 184
kiran puppala Avatar answered Sep 19 '22 18:09

kiran puppala