use of com.android.inputmethod.keyboard.MainKeyboardView in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method onFinishInputInternal.
void onFinishInputInternal() {
super.onFinishInput();
mDictionaryFacilitator.onFinishInput(this);
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
if (mainKeyboardView != null) {
mainKeyboardView.closing();
}
}
use of com.android.inputmethod.keyboard.MainKeyboardView in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method onCodeInput.
// Implementation of {@link KeyboardActionListener}.
@Override
public void onCodeInput(final int codePoint, final int x, final int y, final boolean isKeyRepeat) {
// TODO: this processing does not belong inside LatinIME, the caller should be doing this.
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
// x and y include some padding, but everything down the line (especially native
// code) needs the coordinates in the keyboard frame.
// TODO: We should reconsider which coordinate system should be used to represent
// keyboard event. Also we should pull this up -- LatinIME has no business doing
// this transformation, it should be done already before calling onEvent.
final int keyX = mainKeyboardView.getKeyX(x);
final int keyY = mainKeyboardView.getKeyY(y);
final Event event = createSoftwareKeypressEvent(getCodePointForKeyboard(codePoint), keyX, keyY, isKeyRepeat);
onEvent(event);
}
use of com.android.inputmethod.keyboard.MainKeyboardView in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method onUpdateMainDictionaryAvailability.
// Note that this method is called from a non-UI thread.
@Override
public void onUpdateMainDictionaryAvailability(final boolean isMainDictionaryAvailable) {
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
if (mainKeyboardView != null) {
mainKeyboardView.setMainDictionaryAvailability(isMainDictionaryAvailable);
}
if (mHandler.hasPendingWaitForDictionaryLoad()) {
mHandler.cancelWaitForDictionaryLoad();
mHandler.postResumeSuggestions(false);
}
}
use of com.android.inputmethod.keyboard.MainKeyboardView in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method hapticAndAudioFeedback.
private void hapticAndAudioFeedback(final int code, final int repeatCount) {
final MainKeyboardView keyboardView = mKeyboardSwitcher.getMainKeyboardView();
if (keyboardView != null && keyboardView.isInDraggingFinger()) {
// No need to feedback while finger is dragging.
return;
}
if (repeatCount > 0) {
if (code == Constants.CODE_DELETE && !mInputLogic.mConnection.canDeleteCharacters()) {
// No need to feedback when repeat delete key will have no effect.
return;
}
// a repeat count to thin out feedback.
if (repeatCount % PERIOD_FOR_AUDIO_AND_HAPTIC_FEEDBACK_IN_KEY_REPEAT == 0) {
return;
}
}
final AudioAndHapticFeedbackManager feedbackManager = AudioAndHapticFeedbackManager.getInstance();
if (repeatCount == 0) {
// TODO: Reconsider how to perform haptic feedback when repeating key.
feedbackManager.performHapticFeedback(keyboardView);
}
feedbackManager.performAudioFeedback(code);
}
use of com.android.inputmethod.keyboard.MainKeyboardView in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LatinIME method showGesturePreviewAndSuggestionStrip.
// This method must run on the UI Thread.
void showGesturePreviewAndSuggestionStrip(@Nonnull final SuggestedWords suggestedWords, final boolean dismissGestureFloatingPreviewText) {
showSuggestionStrip(suggestedWords);
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
mainKeyboardView.showGestureFloatingPreviewText(suggestedWords, dismissGestureFloatingPreviewText);
}
Aggregations