aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestionsView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestionsView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java33
1 files changed, 13 insertions, 20 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index e99c6d474..16ecc59ae 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -154,6 +154,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
public final int mSuggestionsCountInStrip;
public final int mMaxMoreSuggestionsRow;
public final float mMinMoreSuggestionsWidth;
+ public final int mMoreSuggestionsBottomGap;
private final List<TextView> mWords;
private final List<View> mDividers;
@@ -222,6 +223,8 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
mCenterSuggestionIndex = mSuggestionsCountInStrip / 2;
mMoreSuggestionsHint = res.getDrawable(R.drawable.more_suggestions_hint);
+ mMoreSuggestionsBottomGap = res.getDimensionPixelOffset(
+ R.dimen.more_suggestions_bottom_gap);
mInvertedForegroundColorSpan = new ForegroundColorSpan(mColorTypedWord ^ 0x00ffffff);
mInvertedBackgroundColorSpan = new BackgroundColorSpan(mColorTypedWord);
@@ -740,7 +743,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final MoreKeysPanel moreKeysPanel = mMoreSuggestionsView;
final int pointX = stripWidth / 2;
- final int pointY = 0;
+ final int pointY = -params.mMoreSuggestionsBottomGap;
moreKeysPanel.showMoreKeysPanel(
this, mMoreSuggestionsController, pointX, pointY,
mMoreSuggestionsWindow, mMoreSuggestionsListener);
@@ -762,29 +765,19 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
if (!mMoreSuggestionsWindow.isShowing()) {
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 PointerTracker tracker = PointerTracker.getPointerTracker(id, mMoreSuggestionsView);
- final int x = mMoreSuggestionsView.translateX((int)me.getX(index));
- final int y = mMoreSuggestionsView.translateY((int)me.getY(index));
- switch (action) {
- case MotionEvent.ACTION_DOWN:
- case MotionEvent.ACTION_POINTER_DOWN:
- tracker.onDownEvent(x, y, eventTime, mMoreSuggestionsView);
- break;
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_POINTER_UP:
- tracker.onUpEvent(x, y, eventTime);
- break;
- case MotionEvent.ACTION_MOVE:
- tracker.onMoveEvent(x, y, eventTime);
- break;
- case MotionEvent.ACTION_CANCEL:
- tracker.onCancelEvent(x, y, eventTime);
- break;
- }
+ final PointerTracker tracker = PointerTracker.getPointerTracker(id, moreKeysPanel);
+ 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);
+
+ tracker.processMotionEvent(action, translatedX, translatedY, eventTime, moreKeysPanel);
return true;
}