From c488121d3822aa72ec22a070121a04bbcfd0c092 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 19 Oct 2019 22:01:44 +0200 Subject: hide 'use integrated emoji' setting for Android O and higher --- .../java/de/pixart/messenger/ui/SettingsActivity.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/SettingsActivity.java') diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java index ba7508556..93b95c9c1 100644 --- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java @@ -298,9 +298,18 @@ public class SettingsActivity extends XmppActivity implements final Preference useBundledEmojis = mSettingsFragment.findPreference("use_bundled_emoji"); if (useBundledEmojis != null) { Log.d(Config.LOGTAG, "Bundled Emoji checkbox checked: " + isBundledEmojiChecked); - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O && isBundledEmojiChecked) { - ((CheckBoxPreference) BundledEmojiPreference).setChecked(false); - useBundledEmojis.setEnabled(false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (isBundledEmojiChecked) { + ((CheckBoxPreference) BundledEmojiPreference).setChecked(false); + useBundledEmojis.setEnabled(false); + } + PreferenceCategory UICatergory = (PreferenceCategory) mSettingsFragment.findPreference("UI"); + UICatergory.removePreference(useBundledEmojis); + if (UICatergory.getPreferenceCount() == 0) { + if (mainPreferenceScreen != null) { + mainPreferenceScreen.removePreference(UICatergory); + } + } } } -- cgit v1.2.3