From f81e24d550c5d71d15cb3af88cb57bbc3a8352a0 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Sun, 19 May 2024 15:26:57 +0200 Subject: [PATCH] allow enabling popups on keypress on tablets still disabled by default, because the popups are too small (size should not be in dp, but in % of screen width or something like that) fixes #799 --- README.md | 2 +- .../latin/settings/PreferencesSettingsFragment.java | 3 --- .../helium314/keyboard/latin/settings/Settings.java | 10 +--------- .../main/res/values-sw430dp/config-per-form-factor.xml | 1 - .../main/res/values-sw600dp/config-per-form-factor.xml | 1 - .../main/res/values-sw768dp/config-per-form-factor.xml | 1 - app/src/main/res/values/config-per-form-factor.xml | 1 - 7 files changed, 2 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 84907492..1e4fd0f6 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ __Planned features and improvements:__ __What will _not_ be added:__ * Material 3 (not worth adding 1.5 MB to app size) * Dictionaries for more languages (you can still download them) -* Anything that requires additional permissions +* Anything that requires additional permissions, unless there is a very good reason # License diff --git a/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java b/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java index 36668d36..4f98a295 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java @@ -49,9 +49,6 @@ public final class PreferencesSettingsFragment extends SubScreenFragment { removePreference(Settings.PREF_VIBRATE_ON); removePreference(Settings.PREF_VIBRATION_DURATION_SETTINGS); } - if (!Settings.readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) { - removePreference(Settings.PREF_POPUP_ON); - } setupKeypressVibrationDurationSettings(); setupKeypressSoundVolumeSettings(); diff --git a/app/src/main/java/helium314/keyboard/latin/settings/Settings.java b/app/src/main/java/helium314/keyboard/latin/settings/Settings.java index a091a069..60812d79 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/Settings.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/Settings.java @@ -303,16 +303,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang return JniUtils.sHaveGestureLib && prefs.getBoolean(PREF_GESTURE_INPUT, true); } - public static boolean readFromBuildConfigIfToShowKeyPreviewPopupOption(final Resources res) { - return res.getBoolean(R.bool.config_enable_show_key_preview_popup_option); - } - public static boolean readKeyPreviewPopupEnabled(final SharedPreferences prefs, final Resources res) { - final boolean defaultKeyPreviewPopup = res.getBoolean( - R.bool.config_default_key_preview_popup); - if (!readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) { - return defaultKeyPreviewPopup; - } + final boolean defaultKeyPreviewPopup = res.getBoolean(R.bool.config_default_key_preview_popup); return prefs.getBoolean(PREF_POPUP_ON, defaultKeyPreviewPopup); } diff --git a/app/src/main/res/values-sw430dp/config-per-form-factor.xml b/app/src/main/res/values-sw430dp/config-per-form-factor.xml index d87ffcef..a4e7de72 100644 --- a/app/src/main/res/values-sw430dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw430dp/config-per-form-factor.xml @@ -7,7 +7,6 @@ - true true false diff --git a/app/src/main/res/values-sw600dp/config-per-form-factor.xml b/app/src/main/res/values-sw600dp/config-per-form-factor.xml index 21942e78..e43101de 100644 --- a/app/src/main/res/values-sw600dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw600dp/config-per-form-factor.xml @@ -7,7 +7,6 @@ - false false false diff --git a/app/src/main/res/values-sw768dp/config-per-form-factor.xml b/app/src/main/res/values-sw768dp/config-per-form-factor.xml index 49f7e17c..d1dbd616 100644 --- a/app/src/main/res/values-sw768dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw768dp/config-per-form-factor.xml @@ -7,7 +7,6 @@ - false false false diff --git a/app/src/main/res/values/config-per-form-factor.xml b/app/src/main/res/values/config-per-form-factor.xml index b27018d2..3633ccde 100644 --- a/app/src/main/res/values/config-per-form-factor.xml +++ b/app/src/main/res/values/config-per-form-factor.xml @@ -7,7 +7,6 @@ - true true false