aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-04-15 04:57:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-15 04:57:33 +0000
commite2af9b7eb519126e67fb054e8bd5064049958feb (patch)
tree19ec9cb2103fedecfbebcca427510915c5e127a0 /java/src
parentc2653d0b5c42290d8e7331617f0207c5a7537f67 (diff)
parent51c38a441a09a4920703e765cb26179e7a80f029 (diff)
downloadlatinime-e2af9b7eb519126e67fb054e8bd5064049958feb.tar.gz
latinime-e2af9b7eb519126e67fb054e8bd5064049958feb.tar.xz
latinime-e2af9b7eb519126e67fb054e8bd5064049958feb.zip
Merge "Reset vertical correction when more suggestions are in modal mode"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java6
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java4
3 files changed, 9 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index a356eb119..a82fb79bd 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -33,7 +33,7 @@ import com.android.inputmethod.latin.R;
public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel {
private final int[] mCoordinates = CoordinateUtils.newInstance();
- private final KeyDetector mKeyDetector;
+ protected final KeyDetector mKeyDetector;
private Controller mController;
protected KeyboardActionListener mListener;
private int mOriginX;
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
index 94715cd84..6509f394b 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
@@ -46,6 +46,12 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
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
public void onCodeInput(final int code, final int x, final int y) {
final int index = code - MoreSuggestions.SUGGESTION_CODE_BASE;
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index 4ef36fa46..2a21ec2f5 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -755,8 +755,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
@Override
public boolean dispatchTouchEvent(final MotionEvent me) {
- if (!mMoreSuggestionsView.isShowingInParent()
- || mMoreSuggestionsMode == MORE_SUGGESTIONS_IN_MODAL_MODE) {
+ if (!mMoreSuggestionsView.isShowingInParent()) {
mLastX = (int)me.getX();
mLastY = (int)me.getY();
if (mMoreSuggestionsSlidingDetector.onTouchEvent(me)) {
@@ -784,6 +783,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP) {
// Decided to be in the modal input mode
mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_MODAL_MODE;
+ mMoreSuggestionsView.adjustVerticalCorrectionForModalMode();
}
return true;
}