Merge "Preventing infinite call of dismissMoreKeysPanel" into ics-mr1

This commit is contained in:
Tadashi G. Takaoka 2011-10-26 17:27:35 -07:00 committed by Android (Google) Code Review
commit a7c419964f
2 changed files with 16 additions and 7 deletions

View file

@ -27,7 +27,6 @@ import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
import com.android.inputmethod.latin.R;
/**
* A view that renders a virtual {@link MiniKeyboard}. It handles rendering of keys and detecting
* key presses and touch movements.
@ -115,7 +114,7 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel {
@Override
public DrawingProxy getDrawingProxy() {
return this;
return this;
}
@Override
@ -174,9 +173,15 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel {
return x;
}
private boolean mIsDismissing;
@Override
public boolean dismissMoreKeysPanel() {
return mController.dismissMoreKeysPanel();
if (mIsDismissing) return false;
mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false;
return dismissed;
}
@Override

View file

@ -35,7 +35,6 @@ import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler;
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
/**
* A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
* key presses and touch movements.
@ -125,7 +124,7 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
@Override
public DrawingProxy getDrawingProxy() {
return this;
return this;
}
@Override
@ -180,10 +179,15 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
return x;
}
private boolean mIsDismissing;
@Override
public boolean dismissMoreKeysPanel() {
if (mController == null) return false;
return mController.dismissMoreKeysPanel();
if (mIsDismissing) return false;
mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false;
return dismissed;
}
@Override