am 83e63ace: Dismiss mini keyboard when finger is released outside mini keyboard

Merge commit '83e63ace2a1bd5b3c27d26d914456c2b0def17c5' into gingerbread-plus-aosp

* commit '83e63ace2a1bd5b3c27d26d914456c2b0def17c5':
  Dismiss mini keyboard when finger is released outside mini keyboard
main
Tadashi G. Takaoka 2010-09-07 01:47:22 -07:00 committed by Android Git Automerger
commit e5abf25d4b
3 changed files with 20 additions and 3 deletions

View File

@ -1213,6 +1213,10 @@ public class LatinIME extends InputMethodService
mEnteredText = text; mEnteredText = text;
} }
public void onCancel() {
// User released a finger outside any key
}
private void handleBackspace() { private void handleBackspace() {
if (VOICE_INSTALLED && mVoiceInputHighlighted) { if (VOICE_INSTALLED && mVoiceInputHighlighted) {
mVoiceInput.incrementTextModificationDeleteCount( mVoiceInput.incrementTextModificationDeleteCount(

View File

@ -123,6 +123,11 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx
*/ */
void onText(CharSequence text); void onText(CharSequence text);
/**
* Called when user released a finger outside any key.
*/
void onCancel();
/** /**
* Called when the user quickly moves the finger from right to * Called when the user quickly moves the finger from right to
* left. * left.
@ -1005,6 +1010,10 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx
dismissPopupKeyboard(); dismissPopupKeyboard();
} }
public void onCancel() {
dismissPopupKeyboard();
}
public void swipeLeft() { public void swipeLeft() {
} }
public void swipeRight() { public void swipeRight() {

View File

@ -389,9 +389,13 @@ public class PointerTracker {
} }
private void detectAndSendKey(int index, int x, int y, long eventTime) { private void detectAndSendKey(int index, int x, int y, long eventTime) {
if (isValidKeyIndex(index)) { final OnKeyboardActionListener listener = mListener;
final Key key = mKeys[index]; final Key key = getKey(index);
OnKeyboardActionListener listener = mListener;
if (key == null) {
if (listener != null)
listener.onCancel();
} else {
if (key.text != null) { if (key.text != null) {
if (listener != null) { if (listener != null) {
listener.onText(key.text); listener.onText(key.text);