Refactoring

This commit is contained in:
M66B
2023-08-25 20:11:33 +02:00
parent db496e7254
commit 4cf027e4c1
2 changed files with 11 additions and 7 deletions

View File

@@ -127,15 +127,19 @@ public class TextHelper {
}
}
static String transliterate(Context context, String text) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
return text;
static String transliterateNotification(Context context, String text) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean notify_transliterate = prefs.getBoolean("notify_transliterate", false);
if (!notify_transliterate)
return text;
return transliterate(context, text);
}
static String transliterate(Context context, String text) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
return text;
try {
// http://userguide.icu-project.org/transforms/general
return Transliterator.getInstance(TRANSLITERATOR).transliterate(text);