Letter icons for non latin characters

pull/168/head
M66B 5 years ago
parent c87db50333
commit 6a547da17b

@ -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) {

@ -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;
}

Loading…
Cancel
Save