From 23fb31854955f2e0600a52c4b9f59f350fa0be35 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 11 Apr 2025 09:36:29 +0700 Subject: [PATCH 1/3] fix(android): Fix system keyboard banner on reload Follows the in-app keyboard pattern of refreshing banner theme when the keyboard is shown Fixes: #13693 --- .../src/main/java/com/keyman/android/SystemKeyboard.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 023195d1c4..e6016202a0 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 @@ -110,9 +110,6 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven @Override public void onInitializeInterface() { super.onInitializeInterface(); - - // KeymanWeb reloaded, so we have to pass the banner again - BannerController.setHTMLBanner(this, KeyboardType.KEYBOARD_TYPE_SYSTEM); } /** @@ -272,7 +269,8 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven @Override public void onKeyboardShown() { - // Do nothing + // Refresh banner theme + BannerController.setHTMLBanner(this, KeyboardType.KEYBOARD_TYPE_SYSTEM); } @Override From 6f6de46467c923fc9bfa614268013a7058b452da Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 11 Apr 2025 11:07:04 +0700 Subject: [PATCH 2/3] fix(oem/fv/android): Fix system keyboard banner on reload Also applied to FirstVoices for Android app --- .../main/java/com/firstvoices/keyboards/SystemKeyboard.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/SystemKeyboard.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/SystemKeyboard.java index 499e0d498b..f991720420 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/SystemKeyboard.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/SystemKeyboard.java @@ -85,9 +85,6 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven @Override public void onInitializeInterface() { super.onInitializeInterface(); - - // KeymanWeb reloaded, so we have to pass the banner again - BannerController.setHTMLBanner(this, KeyboardType.KEYBOARD_TYPE_SYSTEM); } /** Called by the framework when your view for creating input needs to @@ -231,7 +228,8 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven @Override public void onKeyboardShown() { - // Handle Keyman keyboard shown event here if needed + // Refresh banner theme + BannerController.setHTMLBanner(this, KeyboardType.KEYBOARD_TYPE_SYSTEM); } @Override From 0affbd6d4b9fcceb34298b87a730872ed472d963 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 11 Apr 2025 11:07:17 +0700 Subject: [PATCH 3/3] docs(android): Update documentation --- android/docs/engine/KMManager/setHTMLBanner.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/docs/engine/KMManager/setHTMLBanner.md b/android/docs/engine/KMManager/setHTMLBanner.md index 5fcc2c7003..a13fe9da35 100644 --- a/android/docs/engine/KMManager/setHTMLBanner.md +++ b/android/docs/engine/KMManager/setHTMLBanner.md @@ -28,7 +28,7 @@ Use this method to specify the HTML content to display in the banner to theme yo If the banner theme references assets (like .svg or .css files), ensure you've also called [copyHTMLBannerAssets()](copyHTMLBannerAssets). -Note: The HTML banner needs to be updated whenever the keyboard is reloaded, so call this in `SystemKeyboard.onInitializeInterface(()`. +Note: The HTML banner needs to be updated whenever the keyboard is reloaded, so call this in `SystemKeyboard.onKeyboardShown()`. ## Examples