Skip to content
Snippets Groups Projects
Commit 51c38a44 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Reset vertical correction when more suggestions are in modal mode

Bug: 8605150
Change-Id: Iadbebfb80e765c97e58e8524eb87419f2a9e41d4
parent b12c2af3
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ import com.android.inputmethod.latin.R; ...@@ -33,7 +33,7 @@ import com.android.inputmethod.latin.R;
public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel { public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel {
private final int[] mCoordinates = CoordinateUtils.newInstance(); private final int[] mCoordinates = CoordinateUtils.newInstance();
private final KeyDetector mKeyDetector; protected final KeyDetector mKeyDetector;
private Controller mController; private Controller mController;
protected KeyboardActionListener mListener; protected KeyboardActionListener mListener;
private int mOriginX; private int mOriginX;
......
...@@ -46,6 +46,12 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView { ...@@ -46,6 +46,12 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
updateKeyDrawParams(keyHeight); updateKeyDrawParams(keyHeight);
} }
public void adjustVerticalCorrectionForModalMode() {
// Set vertical correction to zero (Reset more keys keyboard sliding allowance
// {@link R#dimen.more_keys_keyboard_slide_allowance}).
mKeyDetector.setKeyboard(getKeyboard(), -getPaddingLeft(), -getPaddingTop());
}
@Override @Override
public void onCodeInput(final int code, final int x, final int y) { public void onCodeInput(final int code, final int x, final int y) {
final int index = code - MoreSuggestions.SUGGESTION_CODE_BASE; final int index = code - MoreSuggestions.SUGGESTION_CODE_BASE;
......
...@@ -755,8 +755,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick ...@@ -755,8 +755,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
@Override @Override
public boolean dispatchTouchEvent(final MotionEvent me) { public boolean dispatchTouchEvent(final MotionEvent me) {
if (!mMoreSuggestionsView.isShowingInParent() if (!mMoreSuggestionsView.isShowingInParent()) {
|| mMoreSuggestionsMode == MORE_SUGGESTIONS_IN_MODAL_MODE) {
mLastX = (int)me.getX(); mLastX = (int)me.getX();
mLastY = (int)me.getY(); mLastY = (int)me.getY();
if (mMoreSuggestionsSlidingDetector.onTouchEvent(me)) { if (mMoreSuggestionsSlidingDetector.onTouchEvent(me)) {
...@@ -784,6 +783,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick ...@@ -784,6 +783,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP) { } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP) {
// Decided to be in the modal input mode // Decided to be in the modal input mode
mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_MODAL_MODE; mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_MODAL_MODE;
mMoreSuggestionsView.adjustVerticalCorrectionForModalMode();
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment