mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 14:02:44 +00:00
qwerty fallback if keyboard parsing fails
This commit is contained in:
parent
1bd585ab76
commit
595e7ab680
1 changed files with 19 additions and 1 deletions
|
@ -36,9 +36,11 @@ import helium314.keyboard.latin.KeyboardWrapperView;
|
|||
import helium314.keyboard.latin.LatinIME;
|
||||
import helium314.keyboard.latin.R;
|
||||
import helium314.keyboard.latin.RichInputMethodManager;
|
||||
import helium314.keyboard.latin.RichInputMethodSubtype;
|
||||
import helium314.keyboard.latin.WordComposer;
|
||||
import helium314.keyboard.latin.settings.Settings;
|
||||
import helium314.keyboard.latin.settings.SettingsValues;
|
||||
import helium314.keyboard.latin.utils.AdditionalSubtypeUtils;
|
||||
import helium314.keyboard.latin.utils.CapsModeUtils;
|
||||
import helium314.keyboard.latin.utils.LanguageOnSpacebarUtils;
|
||||
import helium314.keyboard.latin.utils.Log;
|
||||
|
@ -148,7 +150,23 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
try {
|
||||
mState.onLoadKeyboard(currentAutoCapsState, currentRecapitalizeState, oneHandedModeEnabled);
|
||||
} catch (KeyboardLayoutSetException e) {
|
||||
Log.w(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());
|
||||
Log.e(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());
|
||||
try {
|
||||
final InputMethodSubtype qwerty = AdditionalSubtypeUtils.createEmojiCapableAdditionalSubtype(mRichImm.getCurrentSubtypeLocale(), "qwerty", true);
|
||||
mKeyboardLayoutSet = builder.setKeyboardGeometry(keyboardWidth, keyboardHeight)
|
||||
.setSubtype(new RichInputMethodSubtype(qwerty))
|
||||
.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey)
|
||||
.setNumberRowEnabled(settingsValues.mShowsNumberRow)
|
||||
.setLanguageSwitchKeyEnabled(settingsValues.isLanguageSwitchKeyEnabled())
|
||||
.setEmojiKeyEnabled(settingsValues.mShowsEmojiKey)
|
||||
.setSplitLayoutEnabled(settingsValues.mIsSplitKeyboardEnabled)
|
||||
.setOneHandedModeEnabled(oneHandedModeEnabled)
|
||||
.build();
|
||||
mState.onLoadKeyboard(currentAutoCapsState, currentRecapitalizeState, oneHandedModeEnabled);
|
||||
showToast("error loading the keyboard, falling back to qwerty", false);
|
||||
} catch (KeyboardLayoutSetException e2) {
|
||||
Log.e(TAG, "even fallback to qwerty failed: " + e2.mKeyboardId, e2.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue