mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-10 02:45:32 +00:00
refactor(android/engine): Move toggleSuggestionBanner to KMKeyboard
This commit is contained in:
parent
1184036c7a
commit
e8fa340812
2 changed files with 20 additions and 20 deletions
|
|
@ -422,6 +422,26 @@ final class KMKeyboard extends WebView {
|
|||
|
||||
public static String currentBanner() { return currentBanner; }
|
||||
|
||||
private static void toggleSuggestionBanner(String languageID, boolean inappKeyboardChanged, boolean systemKeyboardChanged) {
|
||||
//reset banner state if new language has no lexical model
|
||||
if (InAppKeyboard != null && InAppKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)
|
||||
&& getAssociatedLexicalModel(languageID)==null) {
|
||||
InAppKeyboard.setCurrentBanner(KMKeyboard.KM_BANNER_STATE_BLANK);
|
||||
}
|
||||
|
||||
if (SystemKeyboard != null && SystemKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)
|
||||
&& getAssociatedLexicalModel(languageID)==null) {
|
||||
SystemKeyboard.setCurrentBanner(KMKeyboard.KM_BANNER_STATE_BLANK);
|
||||
}
|
||||
|
||||
if(inappKeyboardChanged) {
|
||||
InAppKeyboard.setLayoutParams(getKeyboardLayoutParams());
|
||||
}
|
||||
if(systemKeyboardChanged) {
|
||||
SystemKeyboard.setLayoutParams(getKeyboardLayoutParams());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the full path to the display text font. Usually used for creating a Typeface font
|
||||
* @return String
|
||||
|
|
|
|||
|
|
@ -2152,26 +2152,6 @@ public final class KMManager {
|
|||
globeKeyState = state;
|
||||
}
|
||||
|
||||
private static void toggleSuggestionBanner(String languageID, boolean inappKeyboardChanged, boolean systemKeyboardChanged) {
|
||||
//reset banner state if new language has no lexical model
|
||||
if (InAppKeyboard != null && InAppKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)
|
||||
&& getAssociatedLexicalModel(languageID)==null) {
|
||||
InAppKeyboard.setCurrentBanner(KMKeyboard.KM_BANNER_STATE_BLANK);
|
||||
}
|
||||
|
||||
if (SystemKeyboard != null && SystemKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)
|
||||
&& getAssociatedLexicalModel(languageID)==null) {
|
||||
SystemKeyboard.setCurrentBanner(KMKeyboard.KM_BANNER_STATE_BLANK);
|
||||
}
|
||||
|
||||
if(inappKeyboardChanged) {
|
||||
InAppKeyboard.setLayoutParams(getKeyboardLayoutParams());
|
||||
}
|
||||
if(systemKeyboardChanged) {
|
||||
SystemKeyboard.setLayoutParams(getKeyboardLayoutParams());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the lock screen is locked (prevents keyboard picker menu from being displayed)
|
||||
* @return boolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue