diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/xml/spellchecker.xml | 20 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/PopupMiniKeyboardView.java | 13 |
2 files changed, 27 insertions, 6 deletions
diff --git a/java/res/xml/spellchecker.xml b/java/res/xml/spellchecker.xml index ce09264ce..30fac5b20 100644 --- a/java/res/xml/spellchecker.xml +++ b/java/res/xml/spellchecker.xml @@ -23,11 +23,23 @@ <spell-checker xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/spell_checker_service_name"> <subtype - android:label="@string/subtype_en_US" - android:subtypeLocale="en_US" + android:label="@string/subtype_generic" + android:subtypeLocale="en" /> <subtype - android:label="@string/subtype_en_GB" - android:subtypeLocale="en_GB" + android:label="@string/subtype_generic" + android:subtypeLocale="fr" + /> + <subtype + android:label="@string/subtype_generic" + android:subtypeLocale="de" + /> + <subtype + android:label="@string/subtype_generic" + android:subtypeLocale="it" + /> + <subtype + android:label="@string/subtype_generic" + android:subtypeLocale="es" /> </spell-checker> diff --git a/java/src/com/android/inputmethod/keyboard/PopupMiniKeyboardView.java b/java/src/com/android/inputmethod/keyboard/PopupMiniKeyboardView.java index 2396222bc..c3b5825f5 100644 --- a/java/src/com/android/inputmethod/keyboard/PopupMiniKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/PopupMiniKeyboardView.java @@ -213,9 +213,10 @@ public class PopupMiniKeyboardView extends KeyboardView implements PopupPanel { final int pointY = parentKey.mY; final int miniKeyboardLeft = pointX - miniKeyboard.getDefaultCoordX() + parentKeyboardView.getPaddingLeft(); - final int x = Math.max(0, Math.min(miniKeyboardLeft, + final int x = wrapUp(Math.max(0, Math.min(miniKeyboardLeft, parentKeyboardView.getWidth() - miniKeyboard.mOccupiedWidth)) - - container.getPaddingLeft() + mCoordinates[0]; + - container.getPaddingLeft() + mCoordinates[0], + container.getMeasuredWidth(), 0, parentKeyboardView.getWidth()); final int y = pointY - parentKeyboard.mVerticalGap - (container.getMeasuredHeight() - container.getPaddingBottom()) + parentKeyboardView.getPaddingTop() + mCoordinates[1]; @@ -232,6 +233,14 @@ public class PopupMiniKeyboardView extends KeyboardView implements PopupPanel { mOriginY = y + container.getPaddingTop() - mCoordinates[1]; } + private static int wrapUp(int x, int width, int left, int right) { + if (x < left) + return left; + if (x + width > right) + return right - width; + return x; + } + @Override public boolean dismissPopupPanel() { return mParentKeyboardView.dismissPopupPanel(); |