예제 #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;
   }
 }
예제 #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());
 }
예제 #3
0
 // Implements {@link KeyboardState.SwitchActions}.
 @Override
 public void requestUpdatingShiftState() {
   mState.onUpdateShiftState(
       mLatinIME.getCurrentAutoCapsState(), mLatinIME.getCurrentRecapitalizeState());
 }
예제 #4
0
 public void onFinishSlidingInput() {
   mState.onFinishSlidingInput();
 }
예제 #5
0
 public void onReleaseKey(final int code, final boolean withSliding) {
   mState.onReleaseKey(code, withSliding);
 }
예제 #6
0
 public void onPressKey(final int code, final boolean isSinglePointer) {
   mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState());
 }
예제 #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();
 }
예제 #8
0
 /** Update keyboard shift state triggered by connected EditText status change. */
 public void updateShiftState() {
   mState.onUpdateShiftState(
       mLatinIME.getCurrentAutoCapsState(), mLatinIME.getCurrentRecapitalizeState());
 }
예제 #9
0
 public void saveKeyboardState() {
   if (getKeyboard() != null || isShowingEmojiPalettes()) {
     mState.onSaveKeyboardState();
   }
 }