Remove processMotionEvent from MoreKeysKeyboardView

Change-Id: I5373df4a7c82f964f99acf70325bba8702111a75
main
Tadashi G. Takaoka 2013-08-01 16:55:55 +09:00
parent b0ab71be70
commit 33482a9b9c
4 changed files with 8 additions and 19 deletions

View File

@ -974,9 +974,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
// {@link KeyboardView#showKeyPreview(PointerTracker)}.
final int pointY = key.mY + mKeyPreviewDrawParams.mPreviewVisibleOffset;
moreKeysPanel.showMoreKeysPanel(this, this, pointX, pointY, mKeyboardActionListener);
final int translatedX = moreKeysPanel.translateX(CoordinateUtils.x(lastCoords));
final int translatedY = moreKeysPanel.translateY(CoordinateUtils.y(lastCoords));
tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel);
tracker.onShowMoreKeysPanel(moreKeysPanel);
}
public boolean isInSlidingKeyInput() {

View File

@ -198,12 +198,6 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
final int x = (int)me.getX(index);
final int y = (int)me.getY(index);
final int pointerId = me.getPointerId(index);
processMotionEvent(action, x, y, pointerId, eventTime);
return true;
}
public void processMotionEvent(final int action, final int x, final int y,
final int pointerId, final long eventTime) {
switch (action) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_POINTER_DOWN:
@ -217,6 +211,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
onMoveEvent(x, y, pointerId, eventTime);
break;
}
return true;
}
@Override

View File

@ -1282,12 +1282,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
}
}
public void onShowMoreKeysPanel(final int translatedX, final int translatedY,
final MoreKeysPanel panel) {
public void onShowMoreKeysPanel(final MoreKeysPanel panel) {
setReleasedKeyGraphics(mCurrentKey);
final long eventTime = SystemClock.uptimeMillis();
final int translatedX = panel.translateX(mLastX);
final int translatedY = panel.translateY(mLastY);
panel.onDownEvent(translatedX, translatedY, mPointerId, SystemClock.uptimeMillis());
mMoreKeysPanel = panel;
mMoreKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, eventTime);
}
@Override

View File

@ -270,15 +270,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
return super.dispatchTouchEvent(me);
}
final MoreKeysPanel moreKeysPanel = mMoreSuggestionsView;
final int action = me.getAction();
final long eventTime = me.getEventTime();
final int index = me.getActionIndex();
final int id = me.getPointerId(index);
final int x = (int)me.getX(index);
final int y = (int)me.getY(index);
final int translatedX = moreKeysPanel.translateX(x);
final int translatedY = moreKeysPanel.translateY(y);
if (mMoreSuggestionsMode == MORE_SUGGESTIONS_CHECKING_MODAL_OR_SLIDING) {
if (Math.abs(x - mOriginX) >= mMoreSuggestionsModalTolerance
@ -295,7 +290,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
}
// MORE_SUGGESTIONS_IN_SLIDING_MODE
mMoreSuggestionsView.processMotionEvent(action, translatedX, translatedY, id, eventTime);
me.setLocation(mMoreSuggestionsView.translateX(x), mMoreSuggestionsView.translateY(y));
mMoreSuggestionsView.onTouchEvent(me);
return true;
}