Letter icons for non latin characters

This commit is contained in:
M66B 2019-11-22 11:36:49 +01:00
parent c87db50333
commit 6a547da17b
2 changed files with 7 additions and 1 deletions

View File

@ -404,6 +404,12 @@ public class Helper {
return df.format(bytes / Math.pow(unit, exp)) + " " + pre + "B";
}
static boolean isPrintableChar(char c) {
Character.UnicodeBlock block = Character.UnicodeBlock.of(c);
if (block == null || block == Character.UnicodeBlock.SPECIALS)
return false;
return !Character.isISOControl(c);
}
// https://issuetracker.google.com/issues/37054851
static DateFormat getTimeInstance(Context context) {

View File

@ -115,7 +115,7 @@ class ImageHelper {
String letter = null;
for (int i = 0; i < name.length(); i++) {
char kar = name.charAt(i);
if (Character.isAlphabetic(kar)) {
if (Helper.isPrintableChar(kar)) {
letter = name.substring(i, i + 1).toUpperCase();
break;
}