From 3264557bef9715c2df58293f06fd36a4e218aff5 Mon Sep 17 00:00:00 2001 From: Nnyny Date: Thu, 20 Nov 2025 12:44:59 +0700 Subject: [PATCH] chore: add intent to broadcast font name --- .../java/com/keyman/android/SystemKeyboard.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java index f6acd350da..60637ae775 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java +++ b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java @@ -35,6 +35,7 @@ import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputConnection; import android.widget.FrameLayout; +import android.content.Intent; import io.sentry.android.core.SentryAndroid; import io.sentry.Sentry; @@ -139,6 +140,17 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven KMManager.updateSelectionRange(KMManager.KeyboardType.KEYBOARD_TYPE_SYSTEM); } + private void sendCurrentFontName() { + Keyboard keyboardInfo = KMManager.getCurrentKeyboardInfo(this); + if (keyboardInfo != null) { + String fontName = keyboardInfo.getFont(); + + Intent intent = new Intent("com.keyman.android.keyboard_changed"); + intent.putExtra("fontName", fontName); + sendBroadcast(intent); + } + } + /** * This is the main point where we do our initialization of the input method * to begin operating on an application. At this point we have been @@ -197,6 +209,10 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven if (KMManager.isNumericField(inputType)) { KMManager.setNumericLayer(KeyboardType.KEYBOARD_TYPE_SYSTEM); } + + if (KMManager.isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { + sendCurrentFontName(); + } } @Override @@ -264,6 +280,7 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven @Override public void onKeyboardChanged(String newKeyboard) { KMManager.showSystemKeyboard(); + sendCurrentFontName(); } @Override