Esempio n. 1
0
 public void loadKeyboard(final EditorInfo editorInfo, final SettingsValues settingsValues) {
   final KeyboardLayoutSet.Builder builder =
       new KeyboardLayoutSet.Builder(mThemeContext, editorInfo);
   final Resources res = mThemeContext.getResources();
   final int keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res);
   final int keyboardHeight = ResourceUtils.getDefaultKeyboardHeight(res);
   builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);
   builder.setSubtype(mSubtypeSwitcher.getCurrentSubtype());
   builder.setOptions(
       settingsValues.isVoiceKeyEnabled(editorInfo),
       true /* always show a voice key on the main keyboard */,
       settingsValues.isLanguageSwitchKeyEnabled());
   mKeyboardLayoutSet = builder.build();
   try {
     mState.onLoadKeyboard();
   } catch (KeyboardLayoutSetException e) {
     Log.w(TAG, "loading keyboard failed: " + e.mKeyboardId, e.getCause());
     LatinImeLogger.logOnException(e.mKeyboardId.toString(), e.getCause());
     return;
   }
 }
Esempio n. 2
0
 /** Updates state machine to figure out when to automatically switch back to the previous mode. */
 public void onCodeInput(final int code) {
   mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
 }
Esempio n. 3
0
 // Implements {@link KeyboardState.SwitchActions}.
 @Override
 public void requestUpdatingShiftState() {
   mState.onUpdateShiftState(
       mLatinIME.getCurrentAutoCapsState(), mLatinIME.getCurrentRecapitalizeState());
 }
Esempio n. 4
0
 public void onFinishSlidingInput() {
   mState.onFinishSlidingInput();
 }
Esempio n. 5
0
 public void onReleaseKey(final int code, final boolean withSliding) {
   mState.onReleaseKey(code, withSliding);
 }
Esempio n. 6
0
 public void onPressKey(final int code, final boolean isSinglePointer) {
   mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState());
 }
Esempio n. 7
0
 // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
 // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
 public void resetKeyboardStateToAlphabet() {
   mState.onResetKeyboardStateToAlphabet();
 }
Esempio n. 8
0
 /** Update keyboard shift state triggered by connected EditText status change. */
 public void updateShiftState() {
   mState.onUpdateShiftState(
       mLatinIME.getCurrentAutoCapsState(), mLatinIME.getCurrentRecapitalizeState());
 }
Esempio n. 9
0
 public void saveKeyboardState() {
   if (getKeyboard() != null || isShowingEmojiPalettes()) {
     mState.onSaveKeyboardState();
   }
 }