From 81e7199c91f10bd49796faba525467450f5e45b6 Mon Sep 17 00:00:00 2001 From: Fahim Date: Mon, 6 Sep 2021 23:12:58 +0600 Subject: [PATCH 1/4] 3736-Q-Set_voice_input_key_preference_default_false issue: https://gitlab.e.foundation/e/backlog/-/issues/3736 --- java/res/xml/prefs_screen_preferences.xml | 2 +- .../com/android/inputmethod/latin/settings/SettingsValues.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/res/xml/prefs_screen_preferences.xml b/java/res/xml/prefs_screen_preferences.xml index d2dc51e7f1..c7f8b588bb 100644 --- a/java/res/xml/prefs_screen_preferences.xml +++ b/java/res/xml/prefs_screen_preferences.xml @@ -66,6 +66,6 @@ diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 6eb8e98b83..dc21f0b8d0 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -374,7 +374,7 @@ public class SettingsValues { .remove(Settings.PREF_VOICE_MODE_OBSOLETE) .apply(); } - return prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, true); + return prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, false); } public String dump() { -- GitLab From d5857b56afbab55459daa2ce6ac2bbd52ce2610d Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Wed, 4 May 2022 14:08:43 +0000 Subject: [PATCH 2/4] LatinIME: Force disable ime key once again for old updating users --- .../inputmethod/latin/SystemBroadcastReceiver.java | 12 ++++++++++++ .../android/inputmethod/latin/settings/Settings.java | 2 ++ 2 files changed, 14 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java b/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java index 90221512ff..109cace92f 100644 --- a/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java +++ b/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java @@ -86,6 +86,7 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver { } else if (Intent.ACTION_BOOT_COMPLETED.equals(intentAction)) { Log.i(TAG, "Boot has been completed"); toggleAppIcon(context); + disableVoiceKey(context); } else if (Intent.ACTION_LOCALE_CHANGED.equals(intentAction)) { Log.i(TAG, "System locale changed"); KeyboardLayoutSet.onSystemLocaleChanged(); @@ -156,4 +157,15 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver { : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } + + public static void disableVoiceKey(final Context context) { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + if (prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, false) && + !prefs.getBoolean(Settings.PREF_FORCED_DISABLE_VOICE_INPUT_KEY, false)) { + prefs.edit() + .putBoolean(Settings.PREF_VOICE_INPUT_KEY, false) + .putBoolean(Settings.PREF_FORCED_DISABLE_VOICE_INPUT_KEY, true) + .apply(); + } + } } diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java index 803153e7b6..420b61a32c 100644 --- a/java/src/com/android/inputmethod/latin/settings/Settings.java +++ b/java/src/com/android/inputmethod/latin/settings/Settings.java @@ -58,6 +58,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang // PREF_VOICE_MODE_OBSOLETE is obsolete. Use PREF_VOICE_INPUT_KEY instead. public static final String PREF_VOICE_MODE_OBSOLETE = "voice_mode"; public static final String PREF_VOICE_INPUT_KEY = "pref_voice_input_key"; + // Added by /e/ to disable old enabled voice key + public static final String PREF_FORCED_DISABLE_VOICE_INPUT_KEY = "pref_forced_disable_voice_input_key"; public static final String PREF_EDIT_PERSONAL_DICTIONARY = "edit_personal_dictionary"; public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key"; // PREF_AUTO_CORRECTION_THRESHOLD_OBSOLETE is obsolete. Use PREF_AUTO_CORRECTION instead. -- GitLab From b6b794a8f37c13ce533190910c967b731156c04b Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Fri, 2 Sep 2022 12:07:48 +0000 Subject: [PATCH 3/4] LatinIME: Reload theme on configuration change --- java/src/com/android/inputmethod/latin/LatinIME.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 3c891716d9..d01bdd4dc8 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -75,6 +75,7 @@ import com.android.inputmethod.event.InputTransaction; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardId; +import com.android.inputmethod.keyboard.KeyboardLayoutSet; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.Suggest.OnGetSuggestedWordsCallback; @@ -808,6 +809,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen cleanupInternalStateForFinishInput(); } } + KeyboardLayoutSet.onKeyboardThemeChanged(); super.onConfigurationChanged(conf); } -- GitLab From 488593477a40b9b9db111d4abf650f09a9d6e945 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Tue, 26 Sep 2023 17:46:13 +0530 Subject: [PATCH 4/4] Retheme app according to new base --- java/Android.bp | 1 + java/AndroidManifest.xml | 2 +- .../btn_keyboard_key_action_normal_you.xml | 8 ++++++- .../btn_keyboard_key_action_pressed_you.xml | 8 ++++++- java/res/drawable/sym_keyboard_delete_you.xml | 2 +- .../sym_keyboard_language_switch_you.xml | 2 +- .../drawable/sym_keyboard_settings_you.xml | 2 +- java/res/drawable/sym_keyboard_smiley_you.xml | 2 +- java/res/values-night/themes-you-colors.xml | 13 ---------- java/res/values/themes-you-colors.xml | 24 +++++++++---------- java/res/xml/key_styles_common.xml | 3 ++- 11 files changed, 34 insertions(+), 33 deletions(-) diff --git a/java/Android.bp b/java/Android.bp index acf6b26b30..85f305977a 100644 --- a/java/Android.bp +++ b/java/Android.bp @@ -47,6 +47,7 @@ android_app { "androidx.legacy_legacy-support-v4", "androidx.recyclerview_recyclerview", "androidx.viewpager2_viewpager2", + "elib", ], // Do not compress dictionary files to mmap dict data runtime diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index bc63c6a555..fc487c4677 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -19,7 +19,7 @@ package="com.android.inputmethod.latin" android:versionCode="30"> - diff --git a/java/res/drawable/btn_keyboard_key_action_normal_you.xml b/java/res/drawable/btn_keyboard_key_action_normal_you.xml index ab61dafdfd..09f5b819e5 100644 --- a/java/res/drawable/btn_keyboard_key_action_normal_you.xml +++ b/java/res/drawable/btn_keyboard_key_action_normal_you.xml @@ -5,5 +5,11 @@ --> - + + + + diff --git a/java/res/drawable/btn_keyboard_key_action_pressed_you.xml b/java/res/drawable/btn_keyboard_key_action_pressed_you.xml index 6eb85b3d49..e3cada54c0 100644 --- a/java/res/drawable/btn_keyboard_key_action_pressed_you.xml +++ b/java/res/drawable/btn_keyboard_key_action_pressed_you.xml @@ -5,5 +5,11 @@ --> - + + + + diff --git a/java/res/drawable/sym_keyboard_delete_you.xml b/java/res/drawable/sym_keyboard_delete_you.xml index e7ebb4cb63..022e71ca37 100644 --- a/java/res/drawable/sym_keyboard_delete_you.xml +++ b/java/res/drawable/sym_keyboard_delete_you.xml @@ -10,6 +10,6 @@ android:viewportHeight="24" android:autoMirrored="true"> diff --git a/java/res/drawable/sym_keyboard_language_switch_you.xml b/java/res/drawable/sym_keyboard_language_switch_you.xml index 72be14325e..b3805d7547 100644 --- a/java/res/drawable/sym_keyboard_language_switch_you.xml +++ b/java/res/drawable/sym_keyboard_language_switch_you.xml @@ -9,6 +9,6 @@ android:viewportWidth="960" android:viewportHeight="960"> diff --git a/java/res/drawable/sym_keyboard_settings_you.xml b/java/res/drawable/sym_keyboard_settings_you.xml index 9e6b7a5bfa..88110c6f78 100644 --- a/java/res/drawable/sym_keyboard_settings_you.xml +++ b/java/res/drawable/sym_keyboard_settings_you.xml @@ -9,6 +9,6 @@ android:viewportWidth="960" android:viewportHeight="960"> diff --git a/java/res/drawable/sym_keyboard_smiley_you.xml b/java/res/drawable/sym_keyboard_smiley_you.xml index f176197048..f66538080d 100644 --- a/java/res/drawable/sym_keyboard_smiley_you.xml +++ b/java/res/drawable/sym_keyboard_smiley_you.xml @@ -9,6 +9,6 @@ android:viewportWidth="960" android:viewportHeight="960"> diff --git a/java/res/values-night/themes-you-colors.xml b/java/res/values-night/themes-you-colors.xml index a7c03065cd..059dee23c8 100644 --- a/java/res/values-night/themes-you-colors.xml +++ b/java/res/values-night/themes-you-colors.xml @@ -4,19 +4,6 @@ SPDX-License-Identifier: Apache-2.0 --> - @android:color/system_neutral1_900 - - @android:color/system_neutral1_800 - @android:color/system_neutral1_900 - @android:color/system_neutral1_50 - @android:color/system_neutral1_700 - @android:color/system_neutral2_300 - @android:color/system_neutral1_50 - @android:color/system_accent1_400 - @android:color/system_accent1_600 - @android:color/system_neutral1_50 - @android:color/system_neutral1_50 - @android:color/system_neutral1_50 @android:color/system_neutral1_400 @android:color/system_neutral1_50 diff --git a/java/res/values/themes-you-colors.xml b/java/res/values/themes-you-colors.xml index 0dc99259de..02589ba914 100644 --- a/java/res/values/themes-you-colors.xml +++ b/java/res/values/themes-you-colors.xml @@ -4,19 +4,19 @@ SPDX-License-Identifier: Apache-2.0 --> - @android:color/system_neutral1_50 + @color/e_keyboard_background - @android:color/system_neutral1_0 - @android:color/system_neutral1_100 - @android:color/system_neutral1_900 - @android:color/system_accent2_100 - @android:color/system_neutral2_200 - @android:color/system_neutral1_900 - @android:color/system_accent1_200 - @android:color/system_accent1_400 - @android:color/system_neutral1_900 - @android:color/system_neutral1_900 - @android:color/system_neutral1_900 + @color/e_keyboard_key_background + @color/e_keyboard_key_pressed_background + @color/e_keyboard_key_text + @color/e_keyboard_functional_background + @color/e_keyboard_functional_pressed_background + @color/keyboard_key_text_color_you + @color/e_keyboard_key_enter_background + @color/e_keyboard_key_enter_pressed_background + @color/keyboard_key_text_color_you + @color/keyboard_key_text_color_you + @color/keyboard_background_you @android:color/system_neutral1_400 @android:color/system_neutral1_900 diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index a1ce2ea320..2ee5fddf7f 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -80,7 +80,8 @@ + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="functional" />