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.
there app (iquran) available on play google implements functionality.
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
Post a Comment