android - How to color specific characters in an Arabic string? -


in arabic languages, specific characters colored rule. how can color characters. tried coloring using spannable string. sentence gets distorted.

here image show meant distorted.

distort text

there app (iquran) available on play google implements functionality.

enter image description here

so what's best way implement functionality?

the easiest way implement using html.

textview.settext(html.fromhtml("<i><small><font color=\"#c5c5c5\">" + "competitor id: " + "</font></small></i>" + "<font color=\"#47a842\">" + compid + "</font>")); 

you can use

string.replace("arabicchar","</font></small></i>arabicchar<font color=\"#c5c5c5\">" 

and use textview.settext(html.fromhtml(string));


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -