mirror of https://github.com/M66B/FairEmail.git
Load emoji by default
This commit is contained in:
parent
199c5d8b14
commit
0e41fa767f
|
@ -175,7 +175,7 @@ public class ApplicationEx extends Application
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
final boolean crash_reports = prefs.getBoolean("crash_reports", false);
|
||||
final boolean leak_canary = prefs.getBoolean("leak_canary", false);
|
||||
final boolean load_emoji = prefs.getBoolean("load_emoji", false);
|
||||
final boolean load_emoji = prefs.getBoolean("load_emoji", true);
|
||||
|
||||
prev = Thread.getDefaultUncaughtExceptionHandler();
|
||||
|
||||
|
@ -225,12 +225,13 @@ public class ApplicationEx extends Application
|
|||
|
||||
// https://issuetracker.google.com/issues/233525229
|
||||
Log.i("Load emoji=" + load_emoji);
|
||||
if (!load_emoji)
|
||||
try {
|
||||
FontRequestEmojiCompatConfig crying = DefaultEmojiCompatConfig.create(this);
|
||||
if (crying != null) {
|
||||
crying.setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL);
|
||||
EmojiCompat.init(crying);
|
||||
if (load_emoji)
|
||||
EmojiCompat.get().load();
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
|
|
|
@ -646,7 +646,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
|
|||
tvGenericUserAgent.setText(WebViewEx.getUserAgent(getContext()));
|
||||
swGenericUserAgent.setChecked(prefs.getBoolean("generic_ua", false));
|
||||
swSafeBrowsing.setChecked(prefs.getBoolean("safe_browsing", false));
|
||||
swLoadEmoji.setChecked(prefs.getBoolean("load_emoji", false));
|
||||
swLoadEmoji.setChecked(prefs.getBoolean("load_emoji", true));
|
||||
|
||||
long time = prefs.getLong("disconnect_last", -1);
|
||||
DateFormat DF = SimpleDateFormat.getDateTimeInstance();
|
||||
|
|
|
@ -96,6 +96,7 @@ import androidx.annotation.RequiresApi;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.browser.customtabs.CustomTabsClient;
|
||||
import androidx.browser.customtabs.CustomTabsServiceConnection;
|
||||
import androidx.emoji2.text.EmojiCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -2096,6 +2097,35 @@ public class Log {
|
|||
String charset = MimeUtility.getDefaultJavaCharset();
|
||||
sb.append(String.format("Default charset: %s/%s\r\n", charset, MimeUtility.mimeCharset(charset)));
|
||||
|
||||
String emoji;
|
||||
try {
|
||||
if (EmojiCompat.isConfigured()) {
|
||||
int emojiState = EmojiCompat.get().getLoadState();
|
||||
switch (emojiState) {
|
||||
case EmojiCompat.LOAD_STATE_LOADING:
|
||||
emoji = "Loading";
|
||||
break;
|
||||
case EmojiCompat.LOAD_STATE_SUCCEEDED:
|
||||
emoji = "Loaded";
|
||||
break;
|
||||
case EmojiCompat.LOAD_STATE_FAILED:
|
||||
emoji = "Failed";
|
||||
break;
|
||||
case EmojiCompat.LOAD_STATE_DEFAULT:
|
||||
emoji = "Not loaded";
|
||||
break;
|
||||
default:
|
||||
emoji = "?" + emojiState;
|
||||
}
|
||||
} else
|
||||
emoji = "Disabled";
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
emoji = ex.toString();
|
||||
}
|
||||
|
||||
sb.append("Emoji: ").append(emoji).append("\r\n");
|
||||
|
||||
sb.append("Transliterate: ")
|
||||
.append(TextHelper.canTransliterate())
|
||||
.append("\r\n");
|
||||
|
|
Loading…
Reference in New Issue