From 0e8f1e6a723eacf22cc21fad11ec34d441eb02d4 Mon Sep 17 00:00:00 2001 From: frankpreel Date: Tue, 13 May 2025 23:03:01 +0200 Subject: [PATCH 1/6] Theme and display mic icon only if suggestion is available REF: https://gitlab.e.foundation/e/os/backlog/-/issues/3312#note_678851 https://gitlab.e.foundation/e/os/backlog/-/issues/3066 https://gitlab.e.foundation/e/os/backlog/-/issues/3323 --- java/res/drawable/ic_ime_switch.xml | 4 +-- java/res/layout/main_keyboard_frame.xml | 7 ++--- .../android/inputmethod/latin/LatinIME.java | 28 +++++++++++++++++-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/java/res/drawable/ic_ime_switch.xml b/java/res/drawable/ic_ime_switch.xml index 2302161c1c..6cf97a0c77 100644 --- a/java/res/drawable/ic_ime_switch.xml +++ b/java/res/drawable/ic_ime_switch.xml @@ -1,8 +1,8 @@ + android:width="18dp" + android:height="24dp"> diff --git a/java/res/layout/main_keyboard_frame.xml b/java/res/layout/main_keyboard_frame.xml index 89e0f3a96a..4fe2f984a6 100644 --- a/java/res/layout/main_keyboard_frame.xml +++ b/java/res/layout/main_keyboard_frame.xml @@ -51,11 +51,10 @@ Date: Wed, 14 May 2025 09:36:52 +0200 Subject: [PATCH 2/6] Modify icon --- java/res/drawable/ic_ime_switch.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java/res/drawable/ic_ime_switch.xml b/java/res/drawable/ic_ime_switch.xml index 6cf97a0c77..2d931c093c 100644 --- a/java/res/drawable/ic_ime_switch.xml +++ b/java/res/drawable/ic_ime_switch.xml @@ -1,9 +1,9 @@ - + - \ No newline at end of file + android:fillColor="#DEADB5B9" + android:pathData="M12,14c1.66,0 2.99,-1.34 2.99,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17.3,11c0,3 -2.54,5.1 -5.3,5.1S6.7,14 6.7,11L5,11c0,3.41 2.72,6.23 6,6.72L11,21h2v-3.28c3.28,-0.48 6,-3.3 6,-6.72h-1.7z"/> + -- GitLab From 5d78caa38bc97a2067dae0fd6deafecc7c5bee4a Mon Sep 17 00:00:00 2001 From: frankpreel Date: Wed, 14 May 2025 10:49:57 +0200 Subject: [PATCH 3/6] Use native colors --- java/res/drawable/ic_ime_switch.xml | 2 +- .../android/inputmethod/latin/LatinIME.java | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/java/res/drawable/ic_ime_switch.xml b/java/res/drawable/ic_ime_switch.xml index 2d931c093c..128cd4451e 100644 --- a/java/res/drawable/ic_ime_switch.xml +++ b/java/res/drawable/ic_ime_switch.xml @@ -4,6 +4,6 @@ android:viewportWidth="24" android:width="24dp"> diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 98c00f6beb..fe81e052e9 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -910,27 +910,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen switchToSttIme(); } }); - updateFloatingButtonTint(view); manageFloatingButtonVisibility(); } - private void updateFloatingButtonTint(View view) { - int currentNightMode = view.getResources().getConfiguration().uiMode - & Configuration.UI_MODE_NIGHT_MASK; - - int tintColor = Color.BLACK; //Light mode, icon is black - if (currentNightMode == Configuration.UI_MODE_NIGHT_YES) { - tintColor = Color.WHITE; - } - - Drawable icon = ContextCompat.getDrawable(view.getContext(), R.drawable.ic_ime_switch); - if (icon != null) { - icon = DrawableCompat.wrap(icon.mutate()); - DrawableCompat.setTint(icon, tintColor); - floatingButton.setImageDrawable(icon); - } - } - private void manageFloatingButtonVisibility() { final SettingsValues currentSettingsValues = mSettings.getCurrent(); if (shouldShowFloatingButton() && currentSettingsValues.mInputAttributes.mShouldShowSuggestions) { -- GitLab From 491bfea086394f29480cb8b764f625774dafce60 Mon Sep 17 00:00:00 2001 From: frankpreel Date: Wed, 14 May 2025 14:27:53 +0200 Subject: [PATCH 4/6] Remove unused --- java/src/com/android/inputmethod/latin/LatinIME.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index fe81e052e9..021fa27f42 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -27,7 +27,6 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.content.pm.PackageManager; import androidx.core.content.ContextCompat; -import androidx.core.graphics.drawable.DrawableCompat; import android.app.ActivityOptions; import android.app.AlertDialog; import android.content.BroadcastReceiver; -- GitLab From dcd7151cdf161f97df6e9f38e44d17ed4f1aaeea Mon Sep 17 00:00:00 2001 From: frankpreel Date: Wed, 14 May 2025 17:01:48 +0200 Subject: [PATCH 5/6] Remove unused --- java/src/com/android/inputmethod/latin/LatinIME.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 021fa27f42..fc6a4a0d88 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -37,7 +37,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.res.Configuration; import android.content.res.Resources; -import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.inputmethodservice.InputMethodService; -- GitLab From f9d2b2fa6cc694f737a2abb0fe308dac2b0a7b1c Mon Sep 17 00:00:00 2001 From: frankpreel Date: Wed, 14 May 2025 14:27:53 +0200 Subject: [PATCH 6/6] Remove unused Remove unused --- java/src/com/android/inputmethod/latin/LatinIME.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index fe81e052e9..fc6a4a0d88 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -27,7 +27,6 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.content.pm.PackageManager; import androidx.core.content.ContextCompat; -import androidx.core.graphics.drawable.DrawableCompat; import android.app.ActivityOptions; import android.app.AlertDialog; import android.content.BroadcastReceiver; @@ -38,7 +37,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.res.Configuration; import android.content.res.Resources; -import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.inputmethodservice.InputMethodService; -- GitLab