Skip to content

Instantly share code, notes, and snippets.

@alierdogan7
Last active August 26, 2023 22:43
Show Gist options
  • Select an option

  • Save alierdogan7/11f9cfb24f5551c34191485fc764d4c0 to your computer and use it in GitHub Desktop.

Select an option

Save alierdogan7/11f9cfb24f5551c34191485fc764d4c0 to your computer and use it in GitHub Desktop.
Arabic tex view utilities
SpannedString result = new SpannedString("");
for (int j=0;j<myString.length();j++){
Spannable wordtoSpan = new SpannableString(myString.substring(j,j+1));
if (arabicV.contains(myString.substring(j,j+1))) {
wordtoSpan.setSpan(new ForegroundColorSpan(Color.parseColor("#FF0000")),
0, 1, 0);
}
else
{
wordtoSpan.setSpan(new ForegroundColorSpan(Color.parseColor( "#000000")),
0, 1, 0);
}
result = (SpannedString) TextUtils.concat(result,"",wordtoSpan);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment