Merge pull request #13702 from keymanapp/fix/android/broken-banner

fix(android): Fix system  keyboard banner on reload
This commit is contained in:
Darcy Wong 2025-04-21 08:45:45 +07:00 • committed by GitHub
commit 928087e467
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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