diff options
Diffstat (limited to 'java/src/com/android/inputmethod')
14 files changed, 800 insertions, 709 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index 5e8a8f6bb..b41361515 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -71,34 +71,39 @@ public final class KeyboardId { private final EditorInfo mEditorInfo; public final boolean mClobberSettingsKey; public final boolean mShortcutKeyEnabled; - public final boolean mHasShortcutKey; + public final boolean mShortcutKeyOnSymbols; public final boolean mLanguageSwitchKeyEnabled; public final String mCustomActionLabel; + public final boolean mHasShortcutKey; private final int mHashCode; - public KeyboardId(int elementId, InputMethodSubtype subtype, int deviceFormFactor, - int orientation, int width, int mode, EditorInfo editorInfo, boolean clobberSettingsKey, - boolean shortcutKeyEnabled, boolean hasShortcutKey, boolean languageSwitchKeyEnabled) { - mSubtype = subtype; - mLocale = SubtypeLocale.getSubtypeLocale(subtype); - mDeviceFormFactor = deviceFormFactor; - mOrientation = orientation; - mWidth = width; - mMode = mode; + public KeyboardId(final int elementId, final KeyboardLayoutSet.Params params) { + mSubtype = params.mSubtype; + mLocale = SubtypeLocale.getSubtypeLocale(mSubtype); + mDeviceFormFactor = params.mDeviceFormFactor; + mOrientation = params.mOrientation; + mWidth = params.mWidth; + mMode = params.mMode; mElementId = elementId; - mEditorInfo = editorInfo; - mClobberSettingsKey = clobberSettingsKey; - mShortcutKeyEnabled = shortcutKeyEnabled; - mHasShortcutKey = hasShortcutKey; - mLanguageSwitchKeyEnabled = languageSwitchKeyEnabled; - mCustomActionLabel = (editorInfo.actionLabel != null) - ? editorInfo.actionLabel.toString() : null; + mEditorInfo = params.mEditorInfo; + mClobberSettingsKey = params.mNoSettingsKey; + mShortcutKeyEnabled = params.mVoiceKeyEnabled; + mShortcutKeyOnSymbols = mShortcutKeyEnabled && !params.mVoiceKeyOnMain; + mLanguageSwitchKeyEnabled = params.mLanguageSwitchKeyEnabled; + mCustomActionLabel = (mEditorInfo.actionLabel != null) + ? mEditorInfo.actionLabel.toString() : null; + final boolean alphabetMayHaveShortcutKey = isAlphabetKeyboard(elementId) + && !mShortcutKeyOnSymbols; + final boolean symbolsMayHaveShortcutKey = (elementId == KeyboardId.ELEMENT_SYMBOLS) + && mShortcutKeyOnSymbols; + mHasShortcutKey = mShortcutKeyEnabled + && (alphabetMayHaveShortcutKey || symbolsMayHaveShortcutKey); mHashCode = computeHashCode(this); } - private static int computeHashCode(KeyboardId id) { + private static int computeHashCode(final KeyboardId id) { return Arrays.hashCode(new Object[] { id.mDeviceFormFactor, id.mOrientation, @@ -108,7 +113,7 @@ public final class KeyboardId { id.passwordInput(), id.mClobberSettingsKey, id.mShortcutKeyEnabled, - id.mHasShortcutKey, + id.mShortcutKeyOnSymbols, id.mLanguageSwitchKeyEnabled, id.isMultiLine(), id.imeAction(), @@ -119,7 +124,7 @@ public final class KeyboardId { }); } - private boolean equals(KeyboardId other) { + private boolean equals(final KeyboardId other) { if (other == this) return true; return other.mDeviceFormFactor == mDeviceFormFactor @@ -130,7 +135,7 @@ public final class KeyboardId { && other.passwordInput() == passwordInput() && other.mClobberSettingsKey == mClobberSettingsKey && other.mShortcutKeyEnabled == mShortcutKeyEnabled - && other.mHasShortcutKey == mHasShortcutKey + && other.mShortcutKeyOnSymbols == mShortcutKeyOnSymbols && other.mLanguageSwitchKeyEnabled == mLanguageSwitchKeyEnabled && other.isMultiLine() == isMultiLine() && other.imeAction() == imeAction() @@ -140,8 +145,12 @@ public final class KeyboardId { && other.mSubtype.equals(mSubtype); } + private static boolean isAlphabetKeyboard(final int elementId) { + return elementId < ELEMENT_SYMBOLS; + } + public boolean isAlphabetKeyboard() { - return mElementId < ELEMENT_SYMBOLS; + return isAlphabetKeyboard(mElementId); } public boolean navigateNext() { @@ -181,7 +190,7 @@ public final class KeyboardId { } @Override - public boolean equals(Object other) { + public boolean equals(final Object other) { return other instanceof KeyboardId && equals((KeyboardId) other); } @@ -192,7 +201,7 @@ public final class KeyboardId { @Override public String toString() { - return String.format("[%s %s:%s %s-%s:%d %s %s %s%s%s%s%s%s%s%s]", + return String.format("[%s %s:%s %s-%s:%d %s %s %s%s%s%s%s%s%s%s%s]", elementIdToName(mElementId), mLocale, mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET), @@ -204,13 +213,14 @@ public final class KeyboardId { (mClobberSettingsKey ? " clobberSettingsKey" : ""), (passwordInput() ? " passwordInput" : ""), (mShortcutKeyEnabled ? " shortcutKeyEnabled" : ""), + (mShortcutKeyOnSymbols ? " shortcutKeyOnSymbols" : ""), (mHasShortcutKey ? " hasShortcutKey" : ""), (mLanguageSwitchKeyEnabled ? " languageSwitchKeyEnabled" : ""), (isMultiLine() ? "isMultiLine" : "") ); } - public static boolean equivalentEditorInfoForKeyboard(EditorInfo a, EditorInfo b) { + public static boolean equivalentEditorInfoForKeyboard(final EditorInfo a, final EditorInfo b) { if (a == null && b == null) return true; if (a == null || b == null) return false; return a.inputType == b.inputType @@ -218,7 +228,7 @@ public final class KeyboardId { && TextUtils.equals(a.privateImeOptions, b.privateImeOptions); } - public static String elementIdToName(int elementId) { + public static String elementIdToName(final int elementId) { switch (elementId) { case ELEMENT_ALPHABET: return "alphabet"; case ELEMENT_ALPHABET_MANUAL_SHIFTED: return "alphabetManualShifted"; @@ -234,8 +244,8 @@ public final class KeyboardId { } } - public static String deviceFormFactor(int devoceFormFactor) { - switch (devoceFormFactor) { + public static String deviceFormFactor(final int deviceFormFactor) { + switch (deviceFormFactor) { case FORM_FACTOR_PHONE: return "phone"; case FORM_FACTOR_TABLET7: return "tablet7"; case FORM_FACTOR_TABLET10: return "tablet10"; @@ -243,7 +253,7 @@ public final class KeyboardId { } } - public static String modeName(int mode) { + public static String modeName(final int mode) { switch (mode) { case MODE_TEXT: return "text"; case MODE_URL: return "url"; @@ -258,7 +268,7 @@ public final class KeyboardId { } } - public static String actionName(int actionId) { + public static String actionName(final int actionId) { return (actionId == IME_ACTION_CUSTOM_LABEL) ? "actionCustomLabel" : EditorInfoCompatUtils.imeActionName(actionId); } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java index 4d5d7e14e..295047530 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java @@ -78,6 +78,7 @@ public final class KeyboardLayoutSet { CollectionUtils.newHashMap(); private static final KeysCache sKeysCache = new KeysCache(); + @SuppressWarnings("serial") public static final class KeyboardLayoutSetException extends RuntimeException { public final KeyboardId mKeyboardId; @@ -93,7 +94,7 @@ public final class KeyboardLayoutSet { public ElementParams() {} } - private static final class Params { + public static final class Params { String mKeyboardLayoutSetName; int mMode; EditorInfo mEditorInfo; @@ -109,7 +110,6 @@ public final class KeyboardLayoutSet { // Sparse array of KeyboardLayoutSet element parameters indexed by element's id. final SparseArray<ElementParams> mKeyboardLayoutSetElementIdToParamsMap = CollectionUtils.newSparseArray(); - public Params() {} } public static void clearKeyboardCache() { @@ -149,7 +149,11 @@ public final class KeyboardLayoutSet { elementParams = mParams.mKeyboardLayoutSetElementIdToParamsMap.get( KeyboardId.ELEMENT_ALPHABET); } - final KeyboardId id = getKeyboardId(keyboardLayoutSetElementId); + // Note: The keyboard for each shift state, and mode are represented as an elementName + // attribute in a keyboard_layout_set XML file. Also each keyboard layout XML resource is + // specified as an elementKeyboard attribute in the file. + // The KeyboardId is an internal key for a Keyboard object. + final KeyboardId id = new KeyboardId(keyboardLayoutSetElementId, mParams); try { return getKeyboard(elementParams, id); } catch (RuntimeException e) { @@ -187,22 +191,6 @@ public final class KeyboardLayoutSet { return keyboard; } - // Note: The keyboard for each locale, shift state, and mode are represented as - // KeyboardLayoutSet element id that is a key in keyboard_set.xml. Also that file specifies - // which XML layout should be used for each keyboard. The KeyboardId is an internal key for - // Keyboard object. - private KeyboardId getKeyboardId(final int keyboardLayoutSetElementId) { - final Params params = mParams; - final boolean isSymbols = (keyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS - || keyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED); - final boolean hasShortcutKey = params.mVoiceKeyEnabled - && (isSymbols != params.mVoiceKeyOnMain); - return new KeyboardId(keyboardLayoutSetElementId, params.mSubtype, params.mDeviceFormFactor, - params.mOrientation, params.mWidth, params.mMode, params.mEditorInfo, - params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey, - params.mLanguageSwitchKeyEnabled); - } - public static final class Builder { private final Context mContext; private final String mPackageName; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index db1691709..61d38745e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -1013,7 +1013,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, public void closing() { dismissAllKeyPreviews(); cancelAllMessages(); - + onCancelMoreKeysPanel(); mInvalidateAllKeys = true; requestLayout(); } @@ -1032,11 +1032,10 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, } @Override - public boolean dismissMoreKeysPanel() { + public void onCancelMoreKeysPanel() { if (isShowingMoreKeysPanel()) { - return mMoreKeysPanel.dismissMoreKeysPanel(); + mMoreKeysPanel.dismissMoreKeysPanel(); } - return false; } @Override diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 7d7eedb17..584d2fe46 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -135,7 +135,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack private int mAltCodeKeyWhileTypingAnimAlpha = Constants.Color.ALPHA_OPAQUE; // More keys keyboard - private int mMoreKeysPanelPointerTrackerId; private final WeakHashMap<Key, MoreKeysPanel> mMoreKeysPanelCache = new WeakHashMap<Key, MoreKeysPanel>(); private final boolean mConfigShowMoreKeysKeyboardAtTouchedPoint; @@ -662,7 +661,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack } mMoreKeysPanelCache.put(parentKey, moreKeysPanel); } - mMoreKeysPanelPointerTrackerId = tracker.mPointerId; final int[] lastCoords = CoordinateUtils.newInstance(); tracker.getLastCoordinates(lastCoords); @@ -732,14 +730,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack final long eventTime = me.getEventTime(); final int index = me.getActionIndex(); final int id = me.getPointerId(index); - final int x, y; - if (mMoreKeysPanel != null && id == mMoreKeysPanelPointerTrackerId) { - x = mMoreKeysPanel.translateX((int)me.getX(index)); - y = mMoreKeysPanel.translateY((int)me.getY(index)); - } else { - x = (int)me.getX(index); - y = (int)me.getY(index); - } + final int x = (int)me.getX(index); + final int y = (int)me.getY(index); + // TODO: This might be moved to the tracker.processMotionEvent() call below. if (ENABLE_USABILITY_STUDY_LOG && action != MotionEvent.ACTION_MOVE) { writeUsabilityStudyLog(me, action, eventTime, index, id, x, y); @@ -800,19 +793,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack final int pointerId = me.getPointerId(i); final PointerTracker tracker = PointerTracker.getPointerTracker( pointerId, this); - final int px, py; - final MotionEvent motionEvent; - if (mMoreKeysPanel != null - && tracker.mPointerId == mMoreKeysPanelPointerTrackerId) { - px = mMoreKeysPanel.translateX((int)me.getX(i)); - py = mMoreKeysPanel.translateY((int)me.getY(i)); - motionEvent = null; - } else { - px = (int)me.getX(i); - py = (int)me.getY(i); - motionEvent = me; - } - tracker.onMoveEvent(px, py, eventTime, motionEvent); + final int px = (int)me.getX(i); + final int py = (int)me.getY(i); + tracker.onMoveEvent(px, py, eventTime, me); if (ENABLE_USABILITY_STUDY_LOG) { writeUsabilityStudyLog(me, action, eventTime, i, pointerId, px, py); } @@ -861,13 +844,18 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack @Override public void closing() { super.closing(); - dismissMoreKeysPanel(); + onCancelMoreKeysPanel(); mMoreKeysPanelCache.clear(); } @Override + public void onCancelMoreKeysPanel() { + super.onCancelMoreKeysPanel(); + PointerTracker.dismissAllMoreKeysPanels(); + } + + @Override public boolean onDismissMoreKeysPanel() { - mMoreKeysPanelPointerTrackerId = -1; dimEntireKeyboard(false /* dimmed */); return super.onDismissMoreKeysPanel(); } diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java index 16606a1c5..8a5b7dad5 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java @@ -19,76 +19,28 @@ package com.android.inputmethod.keyboard; import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; +import android.view.MotionEvent; import android.view.View; -import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy; -import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.CoordinateUtils; -import com.android.inputmethod.latin.InputPointers; import com.android.inputmethod.latin.R; /** * A view that renders a virtual {@link MoreKeysKeyboard}. It handles rendering of keys and * detecting key presses and touch movements. */ -public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel { +public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel { private final int[] mCoordinates = CoordinateUtils.newInstance(); private final KeyDetector mKeyDetector; - private Controller mController; - private KeyboardActionListener mListener; + protected KeyboardActionListener mListener; private int mOriginX; private int mOriginY; + private Key mCurrentKey; - private static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter(); - - private final KeyboardActionListener mMoreKeysKeyboardListener = - new KeyboardActionListener.Adapter() { - @Override - public void onCodeInput(final int primaryCode, final int x, final int y) { - // Because a more keys keyboard doesn't need proximity characters correction, we don't - // send touch event coordinates. - mListener.onCodeInput( - primaryCode, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE); - } - - @Override - public void onTextInput(final String text) { - mListener.onTextInput(text); - } - - @Override - public void onStartBatchInput() { - mListener.onStartBatchInput(); - } - - @Override - public void onUpdateBatchInput(final InputPointers batchPointers) { - mListener.onUpdateBatchInput(batchPointers); - } - - @Override - public void onEndBatchInput(final InputPointers batchPointers) { - mListener.onEndBatchInput(batchPointers); - } - - @Override - public void onCancelInput() { - mListener.onCancelInput(); - } - - @Override - public void onPressKey(final int primaryCode) { - mListener.onPressKey(primaryCode); - } - - @Override - public void onReleaseKey(final int primaryCode, final boolean withSliding) { - mListener.onReleaseKey(primaryCode, withSliding); - } - }; + private int mActivePointerId; public MoreKeysKeyboardView(final Context context, final AttributeSet attrs) { this(context, attrs, R.attr.moreKeysKeyboardViewStyle); @@ -124,26 +76,6 @@ public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeys } @Override - public KeyDetector getKeyDetector() { - return mKeyDetector; - } - - @Override - public KeyboardActionListener getKeyboardActionListener() { - return mMoreKeysKeyboardListener; - } - - @Override - public DrawingProxy getDrawingProxy() { - return this; - } - - @Override - public TimerProxy getTimerProxy() { - return EMPTY_TIMER_PROXY; - } - - @Override public void setKeyPreviewPopupEnabled(final boolean previewEnabled, final int delay) { // More keys keyboard needs no pop-up key preview displayed, so we pass always false with a // delay of 0. The delay does not matter actually since the popup is not shown anyway. @@ -156,16 +88,14 @@ public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeys mController = controller; mListener = listener; final View container = getContainerView(); - final MoreKeysKeyboard pane = (MoreKeysKeyboard)getKeyboard(); - final int defaultCoordX = pane.getDefaultCoordX(); // The coordinates of panel's left-top corner in parentView's coordinate system. - final int x = pointX - defaultCoordX - container.getPaddingLeft(); + final int x = pointX - getDefaultCoordX() - container.getPaddingLeft(); final int y = pointY - container.getMeasuredHeight() + container.getPaddingBottom(); parentView.getLocationInWindow(mCoordinates); // Ensure the horizontal position of the panel does not extend past the screen edges. final int maxX = parentView.getMeasuredWidth() - container.getMeasuredWidth(); - final int panelX = Math.max(0, Math.min(maxX, x + CoordinateUtils.x(mCoordinates))); + final int panelX = Math.max(0, Math.min(maxX, x)) + CoordinateUtils.x(mCoordinates); final int panelY = y + CoordinateUtils.y(mCoordinates); container.setX(panelX); container.setY(panelY); @@ -175,6 +105,81 @@ public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeys controller.onShowMoreKeysPanel(this); } + /** + * Returns the default x coordinate for showing this panel. + */ + protected int getDefaultCoordX() { + return ((MoreKeysKeyboard)getKeyboard()).getDefaultCoordX(); + } + + @Override + public void onDownEvent(final int x, final int y, final int pointerId, final long eventTime) { + mActivePointerId = pointerId; + onMoveKeyInternal(x, y, pointerId); + } + + @Override + public void onMoveEvent(int x, int y, final int pointerId, long eventTime) { + if (mActivePointerId != pointerId) { + return; + } + final boolean hasOldKey = (mCurrentKey != null); + onMoveKeyInternal(x, y, pointerId); + if (hasOldKey && mCurrentKey == null) { + // If the pointer has moved too far away from any target then cancel the panel. + mController.onCancelMoreKeysPanel(); + } + } + + @Override + public void onUpEvent(final int x, final int y, final int pointerId, final long eventTime) { + if (mCurrentKey != null && mActivePointerId == pointerId) { + updateReleaseKeyGraphics(mCurrentKey); + onCodeInput(mCurrentKey.mCode, x, y); + mCurrentKey = null; + } + } + + /** + * Performs the specific action for this panel when the user presses a key on the panel. + */ + protected void onCodeInput(final int code, final int x, final int y) { + if (code == Constants.CODE_OUTPUT_TEXT) { + mListener.onTextInput(mCurrentKey.getOutputText()); + } else if (code != Constants.CODE_UNSPECIFIED) { + mListener.onCodeInput(code, x, y); + } + } + + private void onMoveKeyInternal(int x, int y, int pointerId) { + if (mActivePointerId != pointerId) { + // Ignore old pointers when newer pointer is active. + return; + } + final Key oldKey = mCurrentKey; + final Key newKey = mKeyDetector.detectHitKey(x, y); + if (newKey != oldKey) { + mCurrentKey = newKey; + invalidateKey(mCurrentKey); + if (oldKey != null) { + updateReleaseKeyGraphics(oldKey); + } + if (newKey != null) { + updatePressKeyGraphics(newKey); + } + } + } + + private void updateReleaseKeyGraphics(final Key key) { + key.onReleased(); + invalidateKey(key); + } + + private void updatePressKeyGraphics(final Key key) { + key.onPressed(); + invalidateKey(key); + } + @Override public boolean dismissMoreKeysPanel() { if (mController == null) return false; @@ -192,6 +197,35 @@ public final class MoreKeysKeyboardView extends KeyboardView implements MoreKeys } @Override + public boolean onTouchEvent(final MotionEvent me) { + final int action = me.getActionMasked(); + final long eventTime = me.getEventTime(); + final int index = me.getActionIndex(); + 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: + onDownEvent(x, y, pointerId, eventTime); + break; + case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_POINTER_UP: + onUpEvent(x, y, pointerId, eventTime); + break; + case MotionEvent.ACTION_MOVE: + onMoveEvent(x, y, pointerId, eventTime); + break; + } + } + + @Override public View getContainerView() { return (View)getParent(); } diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java b/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java index 8bcddccf3..9c677e5c8 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java @@ -18,7 +18,7 @@ package com.android.inputmethod.keyboard; import android.view.View; -public interface MoreKeysPanel extends PointerTracker.KeyEventHandler { +public interface MoreKeysPanel { public interface Controller { /** * Add the {@link MoreKeysPanel} to the target view. @@ -27,9 +27,14 @@ public interface MoreKeysPanel extends PointerTracker.KeyEventHandler { public void onShowMoreKeysPanel(final MoreKeysPanel panel); /** - * Remove the current {@link MoreKeysPanel} to the target view. + * Remove the current {@link MoreKeysPanel} from the target view. */ public boolean onDismissMoreKeysPanel(); + + /** + * Instructs the parent to cancel the panel (e.g., when entering a different input mode). + */ + public void onCancelMoreKeysPanel(); } /** @@ -55,6 +60,36 @@ public interface MoreKeysPanel extends PointerTracker.KeyEventHandler { public boolean dismissMoreKeysPanel(); /** + * Process a move event on the more keys panel. + * + * @param x translated x coordinate of the touch point + * @param y translated y coordinate of the touch point + * @param pointerId pointer id touch point + * @param eventTime timestamp of touch point + */ + public void onMoveEvent(final int x, final int y, final int pointerId, final long eventTime); + + /** + * Process a down event on the more keys panel. + * + * @param x translated x coordinate of the touch point + * @param y translated y coordinate of the touch point + * @param pointerId pointer id touch point + * @param eventTime timestamp of touch point + */ + public void onDownEvent(final int x, final int y, final int pointerId, final long eventTime); + + /** + * Process an up event on the more keys panel. + * + * @param x translated x coordinate of the touch point + * @param y translated y coordinate of the touch point + * @param pointerId pointer id touch point + * @param eventTime timestamp of touch point + */ + public void onUpEvent(final int x, final int y, final int pointerId, final long eventTime); + + /** * Translate X-coordinate of touch event to the local X-coordinate of this * {@link MoreKeysPanel}. * diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index a44f3ede0..0f55607a0 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -84,7 +84,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element { public void showSlidingKeyInputPreview(PointerTracker tracker); public void dismissSlidingKeyInputPreview(); public void showGesturePreviewTrail(PointerTracker tracker, boolean isOldestTracker); - public boolean dismissMoreKeysPanel(); } public interface TimerProxy { @@ -319,8 +318,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element { // true if this pointer is no longer tracking touch event. private boolean mIsTrackingCanceled; - // true if this pointer has been long-pressed and is showing a more keys panel. - private boolean mIsShowingMoreKeysPanel; + // the more keys panel currently being shown. equals null if no panel is active. + private MoreKeysPanel mMoreKeysPanel; // true if this pointer is in a sliding key input. boolean mIsInSlidingKeyInput; @@ -413,6 +412,17 @@ public final class PointerTracker implements PointerTrackerQueue.Element { } } + public static void dismissAllMoreKeysPanels() { + final int trackersSize = sTrackers.size(); + for (int i = 0; i < trackersSize; ++i) { + final PointerTracker tracker = sTrackers.get(i); + if (tracker.isShowingMoreKeysPanel()) { + tracker.mMoreKeysPanel.dismissMoreKeysPanel(); + tracker.mMoreKeysPanel = null; + } + } + } + private PointerTracker(final int id, final KeyEventHandler handler) { if (handler == null) { throw new NullPointerException(); @@ -716,6 +726,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { sLastRecognitionPointSize = 0; sLastRecognitionTime = 0; mListener.onStartBatchInput(); + dismissAllMoreKeysPanels(); } mTimerProxy.cancelLongPressTimer(); mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this)); @@ -812,7 +823,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (DEBUG_EVENT) { printTouchEvent("onDownEvent:", x, y, eventTime); } - mDrawingProxy = handler.getDrawingProxy(); mTimerProxy = handler.getTimerProxy(); setKeyboardActionListener(handler.getKeyboardActionListener()); @@ -848,7 +858,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { } // A gesture should start only from a non-modifier key. mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard() - && !mIsShowingMoreKeysPanel && key != null && !key.isModifier(); + && key != null && !key.isModifier(); if (mIsDetectingGesture) { if (getActivePointerTrackerCount() == 1) { sGestureFirstDownTime = eventTime; @@ -858,6 +868,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element { } } + private boolean isShowingMoreKeysPanel() { + return (mMoreKeysPanel != null); + } + private void onDownEventInternal(final int x, final int y, final long eventTime) { Key key = onDownKey(x, y, eventTime); // Sliding key is allowed when 1) enabled by configuration, 2) this pointer starts sliding @@ -905,6 +919,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element { cancelBatchInput(); return; } + // If the MoreKeysPanel is showing then do not attempt to enter gesture mode. However, + // the gestured touch points are still being recorded in case the panel is dismissed. + if (isShowingMoreKeysPanel()) { + return; + } mayStartBatchInput(key); if (sInGesture) { mayUpdateBatchInput(eventTime, key); @@ -920,6 +939,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element { return; } + if (isShowingMoreKeysPanel()) { + final int translatedX = mMoreKeysPanel.translateX(x); + final int translatedY = mMoreKeysPanel.translateY(y); + mMoreKeysPanel.onMoveEvent(translatedX, translatedY, mPointerId, eventTime); + } + if (sShouldHandleGesture && me != null) { // Add historical points to gesture path. final int pointerIndex = me.findPointerIndex(mPointerId); @@ -933,6 +958,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element { } } + if (isShowingMoreKeysPanel()) { + // Do not handle sliding keys (or show key pop-ups) when the MoreKeysPanel is visible. + return; + } onMoveEventInternal(x, y, eventTime); } @@ -964,7 +993,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.pointerTracker_onMoveEvent(x, y, lastX, lastY); } - onUpEventInternal(eventTime); + onUpEventInternal(x, y, eventTime); onDownEventInternal(x, y, eventTime); } @@ -983,7 +1012,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { lastX, lastY, Constants.printableCode(oldKey.mCode), x, y, Constants.printableCode(key.mCode))); } - onUpEventInternal(eventTime); + onUpEventInternal(x, y, eventTime); onDownEventInternal(x, y, eventTime); } @@ -1099,7 +1128,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { sPointerTrackerQueue.releaseAllPointersOlderThan(this, eventTime); } } - onUpEventInternal(eventTime); + onUpEventInternal(x, y, eventTime); sPointerTrackerQueue.remove(this); } @@ -1111,11 +1140,14 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (DEBUG_EVENT) { printTouchEvent("onPhntEvent:", mLastX, mLastY, eventTime); } - onUpEventInternal(eventTime); + if (isShowingMoreKeysPanel()) { + return; + } + onUpEventInternal(mLastX, mLastY, eventTime); cancelTracking(); } - private void onUpEventInternal(final long eventTime) { + private void onUpEventInternal(final int x, final int y, final long eventTime) { mTimerProxy.cancelKeyTimers(); resetSlidingKeyInput(); mIsDetectingGesture = false; @@ -1123,9 +1155,16 @@ public final class PointerTracker implements PointerTrackerQueue.Element { mCurrentKey = null; // Release the last pressed key. setReleasedKeyGraphics(currentKey); - if (mIsShowingMoreKeysPanel) { - mDrawingProxy.dismissMoreKeysPanel(); - mIsShowingMoreKeysPanel = false; + + if (isShowingMoreKeysPanel()) { + if (!mIsTrackingCanceled) { + final int translatedX = mMoreKeysPanel.translateX(x); + final int translatedY = mMoreKeysPanel.translateY(y); + mMoreKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime); + } + mMoreKeysPanel.dismissMoreKeysPanel(); + mMoreKeysPanel = null; + return; } if (sInGesture) { @@ -1144,10 +1183,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element { } } - public void onShowMoreKeysPanel(final int x, final int y, final KeyEventHandler handler) { - onLongPressed(); - mIsShowingMoreKeysPanel = true; - onDownEvent(x, y, SystemClock.uptimeMillis(), handler); + public void onShowMoreKeysPanel(final int translatedX, final int translatedY, + final MoreKeysPanel panel) { + setReleasedKeyGraphics(mCurrentKey); + final long eventTime = SystemClock.uptimeMillis(); + mMoreKeysPanel = panel; + mMoreKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, eventTime); } @Override @@ -1179,9 +1220,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element { mTimerProxy.cancelKeyTimers(); setReleasedKeyGraphics(mCurrentKey); resetSlidingKeyInput(); - if (mIsShowingMoreKeysPanel) { - mDrawingProxy.dismissMoreKeysPanel(); - mIsShowingMoreKeysPanel = false; + if (isShowingMoreKeysPanel()) { + mMoreKeysPanel.dismissMoreKeysPanel(); + mMoreKeysPanel = null; } } diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java index 36342688e..da418f41a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -622,6 +622,8 @@ public class KeyboardBuilder<KP extends KeyboardParams> { R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey); final boolean shortcutKeyEnabledMatched = matchBoolean(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, id.mShortcutKeyEnabled); + final boolean shortcutKeyOnSymbolsMatched = matchBoolean(a, + R.styleable.Keyboard_Case_shortcutKeyOnSymbols, id.mShortcutKeyOnSymbols); final boolean hasShortcutKeyMatched = matchBoolean(a, R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey); final boolean languageSwitchKeyEnabledMatched = matchBoolean(a, @@ -640,12 +642,12 @@ public class KeyboardBuilder<KP extends KeyboardParams> { final boolean selected = keyboardLayoutSetElementMatched && modeMatched && navigateNextMatched && navigatePreviousMatched && passwordInputMatched && clobberSettingsKeyMatched && shortcutKeyEnabledMatched - && hasShortcutKeyMatched && languageSwitchKeyEnabledMatched - && isMultiLineMatched && imeActionMatched && localeCodeMatched - && languageCodeMatched && countryCodeMatched; + && shortcutKeyOnSymbolsMatched && hasShortcutKeyMatched + && languageSwitchKeyEnabledMatched && isMultiLineMatched && imeActionMatched + && localeCodeMatched && languageCodeMatched && countryCodeMatched; if (DEBUG) { - startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, + startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, textAttr(a.getString( R.styleable.Keyboard_Case_keyboardLayoutSetElement), "keyboardLayoutSetElement"), @@ -662,6 +664,8 @@ public class KeyboardBuilder<KP extends KeyboardParams> { "passwordInput"), booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, "shortcutKeyEnabled"), + booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyOnSymbols, + "shortcutKeyOnSymbols"), booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey, "hasShortcutKey"), booleanAttr(a, R.styleable.Keyboard_Case_languageSwitchKeyEnabled, diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java index 9d0564315..6fefb809b 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java @@ -97,9 +97,6 @@ public final class KeyboardTextsSet { "label_done_key", "label_previous_key", // Other labels. - "label_to_alpha_key", - "label_to_symbol_key", - "label_to_symbol_with_microphone_key", "label_pause_key", "label_wait_key", }; @@ -147,92 +144,95 @@ public final class KeyboardTextsSet { /* 39 */ "keylabel_for_south_slavic_row3_8", /* 40 */ "more_keys_for_cyrillic_ie", /* 41 */ "more_keys_for_cyrillic_i", - /* 42 */ "more_keys_for_single_quote", - /* 43 */ "more_keys_for_double_quote", - /* 44 */ "more_keys_for_tablet_double_quote", - /* 45 */ "more_keys_for_currency_dollar", - /* 46 */ "keylabel_for_currency_generic", - /* 47 */ "more_keys_for_currency_generic", - /* 48 */ "more_keys_for_punctuation", - /* 49 */ "more_keys_for_star", - /* 50 */ "more_keys_for_bullet", - /* 51 */ "more_keys_for_plus", - /* 52 */ "more_keys_for_left_parenthesis", - /* 53 */ "more_keys_for_right_parenthesis", - /* 54 */ "more_keys_for_less_than", - /* 55 */ "more_keys_for_greater_than", - /* 56 */ "more_keys_for_arabic_diacritics", - /* 57 */ "keyhintlabel_for_arabic_diacritics", - /* 58 */ "keylabel_for_symbols_1", - /* 59 */ "keylabel_for_symbols_2", - /* 60 */ "keylabel_for_symbols_3", - /* 61 */ "keylabel_for_symbols_4", - /* 62 */ "keylabel_for_symbols_5", - /* 63 */ "keylabel_for_symbols_6", - /* 64 */ "keylabel_for_symbols_7", - /* 65 */ "keylabel_for_symbols_8", - /* 66 */ "keylabel_for_symbols_9", - /* 67 */ "keylabel_for_symbols_0", - /* 68 */ "additional_more_keys_for_symbols_1", - /* 69 */ "additional_more_keys_for_symbols_2", - /* 70 */ "additional_more_keys_for_symbols_3", - /* 71 */ "additional_more_keys_for_symbols_4", - /* 72 */ "additional_more_keys_for_symbols_5", - /* 73 */ "additional_more_keys_for_symbols_6", - /* 74 */ "additional_more_keys_for_symbols_7", - /* 75 */ "additional_more_keys_for_symbols_8", - /* 76 */ "additional_more_keys_for_symbols_9", - /* 77 */ "additional_more_keys_for_symbols_0", - /* 78 */ "more_keys_for_symbols_1", - /* 79 */ "more_keys_for_symbols_2", - /* 80 */ "more_keys_for_symbols_3", - /* 81 */ "more_keys_for_symbols_4", - /* 82 */ "more_keys_for_symbols_5", - /* 83 */ "more_keys_for_symbols_6", - /* 84 */ "more_keys_for_symbols_7", - /* 85 */ "more_keys_for_symbols_8", - /* 86 */ "more_keys_for_symbols_9", - /* 87 */ "more_keys_for_symbols_0", - /* 88 */ "keylabel_for_comma", - /* 89 */ "more_keys_for_comma", - /* 90 */ "keylabel_for_symbols_question", - /* 91 */ "keylabel_for_symbols_semicolon", - /* 92 */ "keylabel_for_symbols_percent", - /* 93 */ "more_keys_for_symbols_exclamation", - /* 94 */ "more_keys_for_symbols_question", - /* 95 */ "more_keys_for_symbols_semicolon", - /* 96 */ "more_keys_for_symbols_percent", - /* 97 */ "keylabel_for_tablet_comma", - /* 98 */ "keyhintlabel_for_tablet_comma", - /* 99 */ "more_keys_for_tablet_comma", - /* 100 */ "keyhintlabel_for_tablet_period", - /* 101 */ "more_keys_for_tablet_period", - /* 102 */ "keylabel_for_apostrophe", - /* 103 */ "keyhintlabel_for_apostrophe", - /* 104 */ "more_keys_for_apostrophe", - /* 105 */ "more_keys_for_q", - /* 106 */ "more_keys_for_x", - /* 107 */ "keylabel_for_q", - /* 108 */ "keylabel_for_w", - /* 109 */ "keylabel_for_y", - /* 110 */ "keylabel_for_x", - /* 111 */ "keylabel_for_spanish_row2_10", - /* 112 */ "more_keys_for_am_pm", - /* 113 */ "settings_as_more_key", - /* 114 */ "shortcut_as_more_key", - /* 115 */ "action_next_as_more_key", - /* 116 */ "action_previous_as_more_key", - /* 117 */ "label_to_more_symbol_key", - /* 118 */ "label_to_more_symbol_for_tablet_key", - /* 119 */ "label_tab_key", - /* 120 */ "label_to_phone_numeric_key", - /* 121 */ "label_to_phone_symbols_key", - /* 122 */ "label_time_am", - /* 123 */ "label_time_pm", - /* 124 */ "label_to_symbol_key_pcqwerty", - /* 125 */ "keylabel_for_popular_domain", - /* 126 */ "more_keys_for_popular_domain", - /* 127 */ "more_keys_for_smiley", + /* 42 */ "label_to_alpha_key", + /* 43 */ "more_keys_for_single_quote", + /* 44 */ "more_keys_for_double_quote", + /* 45 */ "more_keys_for_tablet_double_quote", + /* 46 */ "more_keys_for_currency_dollar", + /* 47 */ "keylabel_for_currency_generic", + /* 48 */ "more_keys_for_currency_generic", + /* 49 */ "more_keys_for_punctuation", + /* 50 */ "more_keys_for_star", + /* 51 */ "more_keys_for_bullet", + /* 52 */ "more_keys_for_plus", + /* 53 */ "more_keys_for_left_parenthesis", + /* 54 */ "more_keys_for_right_parenthesis", + /* 55 */ "more_keys_for_less_than", + /* 56 */ "more_keys_for_greater_than", + /* 57 */ "more_keys_for_arabic_diacritics", + /* 58 */ "keyhintlabel_for_arabic_diacritics", + /* 59 */ "keylabel_for_symbols_1", + /* 60 */ "keylabel_for_symbols_2", + /* 61 */ "keylabel_for_symbols_3", + /* 62 */ "keylabel_for_symbols_4", + /* 63 */ "keylabel_for_symbols_5", + /* 64 */ "keylabel_for_symbols_6", + /* 65 */ "keylabel_for_symbols_7", + /* 66 */ "keylabel_for_symbols_8", + /* 67 */ "keylabel_for_symbols_9", + /* 68 */ "keylabel_for_symbols_0", + /* 69 */ "label_to_symbol_key", + /* 70 */ "label_to_symbol_with_microphone_key", + /* 71 */ "additional_more_keys_for_symbols_1", + /* 72 */ "additional_more_keys_for_symbols_2", + /* 73 */ "additional_more_keys_for_symbols_3", + /* 74 */ "additional_more_keys_for_symbols_4", + /* 75 */ "additional_more_keys_for_symbols_5", + /* 76 */ "additional_more_keys_for_symbols_6", + /* 77 */ "additional_more_keys_for_symbols_7", + /* 78 */ "additional_more_keys_for_symbols_8", + /* 79 */ "additional_more_keys_for_symbols_9", + /* 80 */ "additional_more_keys_for_symbols_0", + /* 81 */ "more_keys_for_symbols_1", + /* 82 */ "more_keys_for_symbols_2", + /* 83 */ "more_keys_for_symbols_3", + /* 84 */ "more_keys_for_symbols_4", + /* 85 */ "more_keys_for_symbols_5", + /* 86 */ "more_keys_for_symbols_6", + /* 87 */ "more_keys_for_symbols_7", + /* 88 */ "more_keys_for_symbols_8", + /* 89 */ "more_keys_for_symbols_9", + /* 90 */ "more_keys_for_symbols_0", + /* 91 */ "keylabel_for_comma", + /* 92 */ "more_keys_for_comma", + /* 93 */ "keylabel_for_symbols_question", + /* 94 */ "keylabel_for_symbols_semicolon", + /* 95 */ "keylabel_for_symbols_percent", + /* 96 */ "more_keys_for_symbols_exclamation", + /* 97 */ "more_keys_for_symbols_question", + /* 98 */ "more_keys_for_symbols_semicolon", + /* 99 */ "more_keys_for_symbols_percent", + /* 100 */ "keylabel_for_tablet_comma", + /* 101 */ "keyhintlabel_for_tablet_comma", + /* 102 */ "more_keys_for_tablet_comma", + /* 103 */ "keyhintlabel_for_tablet_period", + /* 104 */ "more_keys_for_tablet_period", + /* 105 */ "keylabel_for_apostrophe", + /* 106 */ "keyhintlabel_for_apostrophe", + /* 107 */ "more_keys_for_apostrophe", + /* 108 */ "more_keys_for_q", + /* 109 */ "more_keys_for_x", + /* 110 */ "keylabel_for_q", + /* 111 */ "keylabel_for_w", + /* 112 */ "keylabel_for_y", + /* 113 */ "keylabel_for_x", + /* 114 */ "keylabel_for_spanish_row2_10", + /* 115 */ "more_keys_for_am_pm", + /* 116 */ "settings_as_more_key", + /* 117 */ "shortcut_as_more_key", + /* 118 */ "action_next_as_more_key", + /* 119 */ "action_previous_as_more_key", + /* 120 */ "label_to_more_symbol_key", + /* 121 */ "label_to_more_symbol_for_tablet_key", + /* 122 */ "label_tab_key", + /* 123 */ "label_to_phone_numeric_key", + /* 124 */ "label_to_phone_symbols_key", + /* 125 */ "label_time_am", + /* 126 */ "label_time_pm", + /* 127 */ "label_to_symbol_key_pcqwerty", + /* 128 */ "keylabel_for_popular_domain", + /* 129 */ "more_keys_for_popular_domain", + /* 130 */ "more_keys_for_smiley", }; private static final String EMPTY = ""; @@ -245,38 +245,40 @@ public final class KeyboardTextsSet { EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, /* ~41 */ - /* 42 */ "!fixedColumnOrder!4,\u2018,\u2019,\u201A,\u201B", + // Label for "switch to alphabetic" key. + /* 42 */ "ABC", + /* 43 */ "!fixedColumnOrder!4,\u2018,\u2019,\u201A,\u201B", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»</string> - /* 43 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB,\u00BB", + /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB,\u00BB", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", + /* 45 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", // U+00A2: "¢" CENT SIGN // U+00A3: "£" POUND SIGN // U+20AC: "€" EURO SIGN // U+00A5: "¥" YEN SIGN // U+20B1: "₱" PESO SIGN - /* 45 */ "\u00A2,\u00A3,\u20AC,\u00A5,\u20B1", - /* 46 */ "$", - /* 47 */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1", - /* 48 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\\,,?,@,&,\\%,+,;,/,(,)", + /* 46 */ "\u00A2,\u00A3,\u20AC,\u00A5,\u20B1", + /* 47 */ "$", + /* 48 */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1", + /* 49 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\\,,?,@,&,\\%,+,;,/,(,)", // U+2020: "†" DAGGER // U+2021: "‡" DOUBLE DAGGER // U+2605: "★" BLACK STAR - /* 49 */ "\u2020,\u2021,\u2605", + /* 50 */ "\u2020,\u2021,\u2605", // U+266A: "♪" EIGHTH NOTE // U+2665: "♥" BLACK HEART SUIT // U+2660: "♠" BLACK SPADE SUIT // U+2666: "♦" BLACK DIAMOND SUIT // U+2663: "♣" BLACK CLUB SUIT - /* 50 */ "\u266A,\u2665,\u2660,\u2666,\u2663", + /* 51 */ "\u266A,\u2665,\u2660,\u2666,\u2663", // U+00B1: "±" PLUS-MINUS SIGN - /* 51 */ "\u00B1", + /* 52 */ "\u00B1", // The all letters need to be mirrored are found at // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt - /* 52 */ "!fixedColumnOrder!3,<,{,[", - /* 53 */ "!fixedColumnOrder!3,>,},]", + /* 53 */ "!fixedColumnOrder!3,<,{,[", + /* 54 */ "!fixedColumnOrder!3,>,},]", // U+2039: "‹" SINGLE LEFT-POINTING ANGLE QUOTATION MARK // U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK // U+2264: "≤" LESS-THAN OR EQUAL TO @@ -292,103 +294,108 @@ public final class KeyboardTextsSet { // U+201D: "”" RIGHT DOUBLE QUOTATION MARK // U+201E: "„" DOUBLE LOW-9 QUOTATION MARK // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK - /* 54 */ "!fixedColumnOrder!3,\u2039,\u2264,\u00AB", - /* 55 */ "!fixedColumnOrder!3,\u203A,\u2265,\u00BB", - /* 56 */ EMPTY, + /* 55 */ "!fixedColumnOrder!3,\u2039,\u2264,\u00AB", + /* 56 */ "!fixedColumnOrder!3,\u203A,\u2265,\u00BB", /* 57 */ EMPTY, - /* 58 */ "1", - /* 59 */ "2", - /* 60 */ "3", - /* 61 */ "4", - /* 62 */ "5", - /* 63 */ "6", - /* 64 */ "7", - /* 65 */ "8", - /* 66 */ "9", - /* 67 */ "0", - /* 68~ */ + /* 58 */ EMPTY, + /* 59 */ "1", + /* 60 */ "2", + /* 61 */ "3", + /* 62 */ "4", + /* 63 */ "5", + /* 64 */ "6", + /* 65 */ "7", + /* 66 */ "8", + /* 67 */ "9", + /* 68 */ "0", + // Label for "switch to symbols" key. + /* 69 */ "?123", + // Label for "switch to symbols with microphone" key. This string shouldn't include the "mic" + // part because it'll be appended by the code. + /* 70 */ "123", + /* 71~ */ EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, - /* ~77 */ + /* ~80 */ // U+00B9: "¹" SUPERSCRIPT ONE // U+00BD: "½" VULGAR FRACTION ONE HALF // U+2153: "⅓" VULGAR FRACTION ONE THIRD // U+00BC: "¼" VULGAR FRACTION ONE QUARTER // U+215B: "⅛" VULGAR FRACTION ONE EIGHTH - /* 78 */ "\u00B9,\u00BD,\u2153,\u00BC,\u215B", + /* 81 */ "\u00B9,\u00BD,\u2153,\u00BC,\u215B", // U+00B2: "²" SUPERSCRIPT TWO // U+2154: "⅔" VULGAR FRACTION TWO THIRDS - /* 79 */ "\u00B2,\u2154", + /* 82 */ "\u00B2,\u2154", // U+00B3: "³" SUPERSCRIPT THREE // U+00BE: "¾" VULGAR FRACTION THREE QUARTERS // U+215C: "⅜" VULGAR FRACTION THREE EIGHTHS - /* 80 */ "\u00B3,\u00BE,\u215C", + /* 83 */ "\u00B3,\u00BE,\u215C", // U+2074: "⁴" SUPERSCRIPT FOUR - /* 81 */ "\u2074", + /* 84 */ "\u2074", // U+215D: "⅝" VULGAR FRACTION FIVE EIGHTHS - /* 82 */ "\u215D", - /* 83 */ EMPTY, - // U+215E: "⅞" VULGAR FRACTION SEVEN EIGHTHS - /* 84 */ "\u215E", - /* 85 */ EMPTY, + /* 85 */ "\u215D", /* 86 */ EMPTY, + // U+215E: "⅞" VULGAR FRACTION SEVEN EIGHTHS + /* 87 */ "\u215E", + /* 88 */ EMPTY, + /* 89 */ EMPTY, // U+207F: "ⁿ" SUPERSCRIPT LATIN SMALL LETTER N // U+2205: "∅" EMPTY SET - /* 87 */ "\u207F,\u2205", - /* 88 */ ",", - /* 89 */ EMPTY, - /* 90 */ "?", - /* 91 */ ";", - /* 92 */ "%", + /* 90 */ "\u207F,\u2205", + /* 91 */ ",", + /* 92 */ EMPTY, + /* 93 */ "?", + /* 94 */ ";", + /* 95 */ "%", // U+00A1: "¡" INVERTED EXCLAMATION MARK - /* 93 */ "\u00A1", + /* 96 */ "\u00A1", // U+00BF: "¿" INVERTED QUESTION MARK - /* 94 */ "\u00BF", - /* 95 */ EMPTY, + /* 97 */ "\u00BF", + /* 98 */ EMPTY, // U+2030: "‰" PER MILLE SIGN - /* 96 */ "\u2030", - /* 97 */ ",", - /* 98 */ "!", - /* 99 */ "!", - /* 100 */ "?", - /* 101 */ "?", - /* 102 */ "\'", - /* 103 */ "\"", - /* 104 */ "\"", - /* 105 */ EMPTY, - /* 106 */ EMPTY, - /* 107 */ "q", - /* 108 */ "w", - /* 109 */ "y", - /* 110 */ "x", + /* 99 */ "\u2030", + /* 100 */ ",", + /* 101 */ "!", + /* 102 */ "!", + /* 103 */ "?", + /* 104 */ "?", + /* 105 */ "\'", + /* 106 */ "\"", + /* 107 */ "\"", + /* 108 */ EMPTY, + /* 109 */ EMPTY, + /* 110 */ "q", + /* 111 */ "w", + /* 112 */ "y", + /* 113 */ "x", // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE - /* 111 */ "\u00F1", - /* 112 */ "!fixedColumnOrder!2,!hasLabels!,!text/label_time_am,!text/label_time_pm", - /* 113 */ "!icon/settings_key|!code/key_settings", - /* 114 */ "!icon/shortcut_key|!code/key_shortcut", - /* 115 */ "!hasLabels!,!text/label_next_key|!code/key_action_next", - /* 116 */ "!hasLabels!,!text/label_previous_key|!code/key_action_previous", + /* 114 */ "\u00F1", + /* 115 */ "!fixedColumnOrder!2,!hasLabels!,!text/label_time_am,!text/label_time_pm", + /* 116 */ "!icon/settings_key|!code/key_settings", + /* 117 */ "!icon/shortcut_key|!code/key_shortcut", + /* 118 */ "!hasLabels!,!text/label_next_key|!code/key_action_next", + /* 119 */ "!hasLabels!,!text/label_previous_key|!code/key_action_previous", // Label for "switch to more symbol" modifier key. Must be short to fit on key! - /* 117 */ "= \\ <", + /* 120 */ "= \\ <", // Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! - /* 118 */ "~ \\ {", + /* 121 */ "~ \\ {", // Label for "Tab" key. Must be short to fit on key! - /* 119 */ "Tab", + /* 122 */ "Tab", // Label for "switch to phone numeric" key. Must be short to fit on key! - /* 120 */ "123", + /* 123 */ "123", // Label for "switch to phone symbols" key. Must be short to fit on key! // U+FF0A: "*" FULLWIDTH ASTERISK // U+FF03: "#" FULLWIDTH NUMBER SIGN - /* 121 */ "\uFF0A\uFF03", + /* 124 */ "\uFF0A\uFF03", // Key label for "ante meridiem" - /* 122 */ "AM", + /* 125 */ "AM", // Key label for "post meridiem" - /* 123 */ "PM", + /* 126 */ "PM", // Label for "switch to symbols" key on PC QWERTY layout - /* 124 */ "Sym", - /* 125 */ ".com", + /* 127 */ "Sym", + /* 128 */ ".com", // popular web domains for the locale - most popular, displayed on the keyboard - /* 126 */ "!hasLabels!,.net,.org,.gov,.edu", - /* 127 */ "!fixedColumnOrder!5,!hasLabels!,=-O|=-O ,:-P|:-P ,;-)|;-) ,:-(|:-( ,:-)|:-) ,:-!|:-! ,:-$|:-$ ,B-)|B-) ,:O|:O ,:-*|:-* ,:-D|:-D ,:\'(|:\'( ,:-\\\\|:-\\\\ ,O:-)|O:-) ,:-[|:-[ ", + /* 129 */ "!hasLabels!,.net,.org,.gov,.edu", + /* 130 */ "!fixedColumnOrder!5,!hasLabels!,=-O|=-O ,:-P|:-P ,;-)|;-) ,:-(|:-( ,:-)|:-) ,:-!|:-! ,:-$|:-$ ,B-)|B-) ,:O|:O ,:-*|:-* ,:-D|:-D ,:\'(|:\'( ,:-\\\\|:-\\\\ ,O:-)|O:-) ,:-[|:-[ ", }; /* Language af: Afrikaans */ @@ -449,39 +456,46 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~42 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0623: "ا" ARABIC LETTER ALEF + // U+200C: ZERO WIDTH NON-JOINER + // U+0628: "ب" ARABIC LETTER BEH + // U+062C: "پ" ARABIC LETTER PEH + /* 42 */ "\u0623\u200C\u0628\u200C\u062C", + /* 43 */ null, // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_double_quote">“,”,„,‟,«|»,»|«</string> - /* 43 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB", + /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«|»,»|«;,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", + /* 45 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", // U+00A2: "¢" CENT SIGN // U+00A3: "£" POUND SIGN // U+20AC: "€" EURO SIGN // U+00A5: "¥" YEN SIGN // U+20B1: "₱" PESO SIGN // U+FDFC: "﷼" RIAL SIGN - /* 45 */ "\u00A2,\u00A3,\u20AC,\u00A5,\u20B1,\uFDFC", - /* 46 */ null, + /* 46 */ "\u00A2,\u00A3,\u20AC,\u00A5,\u20B1,\uFDFC", /* 47 */ null, + /* 48 */ null, // U+061F: "؟" ARABIC QUESTION MARK // U+060C: "،" ARABIC COMMA // U+061B: "؛" ARABIC SEMICOLON - /* 48 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\u060C,\u061F,@,&,\\%,+,\u061B,/,(,)", + /* 49 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\u060C,\u061F,@,&,\\%,+,\u061B,/,(,)", // U+2605: "★" BLACK STAR // U+066D: "٭" ARABIC FIVE POINTED STAR - /* 49 */ "\u2605,\u066D", + /* 50 */ "\u2605,\u066D", // U+266A: "♪" EIGHTH NOTE - /* 50 */ "\u266A", - /* 51 */ null, + /* 51 */ "\u266A", + /* 52 */ null, // The all letters need to be mirrored are found at // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt // U+FD3E: "﴾" ORNATE LEFT PARENTHESIS // U+FD3F: "﴿" ORNATE RIGHT PARENTHESIS - /* 52 */ "!fixedColumnOrder!4,\uFD3E|\uFD3F,<|>,{|},[|]", - /* 53 */ "!fixedColumnOrder!4,\uFD3F|\uFD3E,>|<,}|{,]|[", + /* 53 */ "!fixedColumnOrder!4,\uFD3E|\uFD3F,<|>,{|},[|]", + /* 54 */ "!fixedColumnOrder!4,\uFD3F|\uFD3E,>|<,}|{,]|[", // U+2264: "≤" LESS-THAN OR EQUAL TO // U+2265: "≥" GREATER-THAN EQUAL TO // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -497,8 +511,8 @@ public final class KeyboardTextsSet { // U+201D: "”" RIGHT DOUBLE QUOTATION MARK // U+201E: "„" DOUBLE LOW-9 QUOTATION MARK // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK - /* 54 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", - /* 55 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", + /* 55 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", + /* 56 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", // U+0655: "ٕ" ARABIC HAMZA BELOW // U+0654: "ٔ" ARABIC HAMZA ABOVE // U+0652: "ْ" ARABIC SUKUN @@ -514,64 +528,70 @@ public final class KeyboardTextsSet { // U+064E: "َ" ARABIC FATHA // U+0640: "ـ" ARABIC TATWEEL // In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. - /* 56 */ "!fixedColumnOrder!7,\u0655,\u0654,\u0652,\u064D,\u064C,\u064B,\u0651,\u0656,\u0670,\u0653,\u0650,\u064F,\u064E,\u0640\u0640\u0640|\u0640", - /* 57 */ "\u0651", + /* 57 */ "!fixedColumnOrder!7,\u0655,\u0654,\u0652,\u064D,\u064C,\u064B,\u0651,\u0656,\u0670,\u0653,\u0650,\u064F,\u064E,\u0640\u0640\u0640|\u0640", + /* 58 */ "\u0651", // U+0661: "١" ARABIC-INDIC DIGIT ONE - /* 58 */ "\u0661", + /* 59 */ "\u0661", // U+0662: "٢" ARABIC-INDIC DIGIT TWO - /* 59 */ "\u0662", + /* 60 */ "\u0662", // U+0663: "٣" ARABIC-INDIC DIGIT THREE - /* 60 */ "\u0663", + /* 61 */ "\u0663", // U+0664: "٤" ARABIC-INDIC DIGIT FOUR - /* 61 */ "\u0664", + /* 62 */ "\u0664", // U+0665: "٥" ARABIC-INDIC DIGIT FIVE - /* 62 */ "\u0665", + /* 63 */ "\u0665", // U+0666: "٦" ARABIC-INDIC DIGIT SIX - /* 63 */ "\u0666", + /* 64 */ "\u0666", // U+0667: "٧" ARABIC-INDIC DIGIT SEVEN - /* 64 */ "\u0667", + /* 65 */ "\u0667", // U+0668: "٨" ARABIC-INDIC DIGIT EIGHT - /* 65 */ "\u0668", + /* 66 */ "\u0668", // U+0669: "٩" ARABIC-INDIC DIGIT NINE - /* 66 */ "\u0669", + /* 67 */ "\u0669", // U+0660: "٠" ARABIC-INDIC DIGIT ZERO - /* 67 */ "\u0660", - /* 68 */ "1", - /* 69 */ "2", - /* 70 */ "3", - /* 71 */ "4", - /* 72 */ "5", - /* 73 */ "6", - /* 74 */ "7", - /* 75 */ "8", - /* 76 */ "9", + /* 68 */ "\u0660", + // Label for "switch to symbols" key. + // U+061F: "؟" ARABIC QUESTION MARK + /* 69 */ "\u0663\u0662\u0661\u061F", + // Label for "switch to symbols with microphone" key. This string shouldn't include the "mic" + // part because it'll be appended by the code. + /* 70 */ "\u0663\u0662\u0661", + /* 71 */ "1", + /* 72 */ "2", + /* 73 */ "3", + /* 74 */ "4", + /* 75 */ "5", + /* 76 */ "6", + /* 77 */ "7", + /* 78 */ "8", + /* 79 */ "9", // U+066B: "٫" ARABIC DECIMAL SEPARATOR // U+066C: "٬" ARABIC THOUSANDS SEPARATOR - /* 77 */ "0,\u066B,\u066C", - /* 78~ */ + /* 80 */ "0,\u066B,\u066C", + /* 81~ */ null, null, null, null, null, null, null, null, null, null, - /* ~87 */ + /* ~90 */ // U+060C: "،" ARABIC COMMA - /* 88 */ "\u060C", - /* 89 */ "\\,", - /* 90 */ "\u061F", - /* 91 */ "\u061B", + /* 91 */ "\u060C", + /* 92 */ "\\,", + /* 93 */ "\u061F", + /* 94 */ "\u061B", // U+066A: "٪" ARABIC PERCENT SIGN - /* 92 */ "\u066A", - /* 93 */ null, - /* 94 */ "?", - /* 95 */ ";", + /* 95 */ "\u066A", + /* 96 */ null, + /* 97 */ "?", + /* 98 */ ";", // U+2030: "‰" PER MILLE SIGN - /* 96 */ "\\%,\u2030", - /* 97~ */ + /* 99 */ "\\%,\u2030", + /* 100~ */ null, null, null, null, null, - /* ~101 */ + /* ~104 */ // U+060C: "،" ARABIC COMMA // U+061B: "؛" ARABIC SEMICOLON // U+061F: "؟" ARABIC QUESTION MARK - /* 102 */ "\u060C", - /* 103 */ "\u061F", - /* 104 */ "\u061F,\u061B,!,:,-,/,\',\"", + /* 105 */ "\u060C", + /* 106 */ "\u061F", + /* 107 */ "\u061F,\u061B,!,:,-,/,\',\"", }; /* Language be: Belarusian */ @@ -600,6 +620,26 @@ public final class KeyboardTextsSet { /* ~39 */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* 40 */ "\u0451", + /* 41 */ null, + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", + }; + + /* Language bg: Bulgarian */ + private static final String[] LANGUAGE_bg = { + /* 0~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", }; /* Language ca: Catalan */ @@ -835,6 +875,20 @@ public final class KeyboardTextsSet { /* 6 */ "\u00F1,\u0144", }; + /* Language el: Greek */ + private static final String[] LANGUAGE_el = { + /* 0~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0391: "Α" GREEK CAPITAL LETTER ALPHA + // U+0392: "Β" GREEK CAPITAL LETTER BETA + // U+0393: "Γ" GREEK CAPITAL LETTER GAMMA + /* 42 */ "\u0391\u0392\u0393", + }; + /* Language en: English */ private static final String[] LANGUAGE_en = { // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE @@ -1003,20 +1057,20 @@ public final class KeyboardTextsSet { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, - /* ~104 */ - /* 105 */ "q", - /* 106 */ "x", + null, null, null, null, null, null, null, null, null, null, null, null, null, + /* ~107 */ + /* 108 */ "q", + /* 109 */ "x", // U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX - /* 107 */ "\u015D", + /* 110 */ "\u015D", // U+011D: "ĝ" LATIN SMALL LETTER G WITH CIRCUMFLEX - /* 108 */ "\u011D", + /* 111 */ "\u011D", // U+016D: "ŭ" LATIN SMALL LETTER U WITH BREVE - /* 109 */ "\u016D", + /* 112 */ "\u016D", // U+0109: "ĉ" LATIN SMALL LETTER C WITH CIRCUMFLEX - /* 110 */ "\u0109", + /* 113 */ "\u0109", // U+0135: "ĵ" LATIN SMALL LETTER J WITH CIRCUMFLEX - /* 111 */ "\u0135", + /* 114 */ "\u0135", }; /* Language es: Spanish */ @@ -1074,25 +1128,25 @@ public final class KeyboardTextsSet { /* 8~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, - /* ~47 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~48 */ // U+00A1: "¡" INVERTED EXCLAMATION MARK // U+00BF: "¿" INVERTED QUESTION MARK - /* 48 */ "!fixedColumnOrder!9,\u00A1,\",\',#,-,:,!,\\,,?,\u00BF,@,&,\\%,+,;,/,(,)", - /* 49~ */ + /* 49 */ "!fixedColumnOrder!9,\u00A1,\",\',#,-,:,!,\\,,?,\u00BF,@,&,\\%,+,;,/,(,)", + /* 50~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, - /* ~98 */ + null, null, null, null, null, null, null, + /* ~101 */ // U+00A1: "¡" INVERTED EXCLAMATION MARK - /* 99 */ "!,\u00A1", - /* 100 */ null, + /* 102 */ "!,\u00A1", + /* 103 */ null, // U+00BF: "¿" INVERTED QUESTION MARK - /* 101 */ "?,\u00BF", - /* 102 */ "\"", - /* 103 */ "\'", - /* 104 */ "\'", + /* 104 */ "?,\u00BF", + /* 105 */ "\"", + /* 106 */ "\'", + /* 107 */ "\'", }; /* Language et: Estonian */ @@ -1200,15 +1254,22 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~42 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0627: "ا" ARABIC LETTER ALEF + // U+200C: ZERO WIDTH NON-JOINER + // U+0628: "ب" ARABIC LETTER BEH + // U+067E: "پ" ARABIC LETTER PEH + /* 42 */ "\u0627\u200C\u0628\u200C\u067E", + /* 43 */ null, // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_double_quote">“,”,„,‟,«|»,»|«</string> - /* 43 */ "!fixedColumnOrder!4,\u201C,\u201D,\",\'", + /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\",\'", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«|»,»|«;,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", - /* 45 */ null, + /* 45 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", + /* 46 */ null, // U+FDFC: "﷼" RIAL SIGN // U+060B: "؋" AFGHANI SIGN // U+00A2: "¢" CENT SIGN @@ -1216,24 +1277,24 @@ public final class KeyboardTextsSet { // U+20AC: "€" EURO SIGN // U+00A5: "¥" YEN SIGN // U+20B1: "₱" PESO SIGN - /* 46 */ "\uFDFC", - /* 47 */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1,\u060B", + /* 47 */ "\uFDFC", + /* 48 */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1,\u060B", // U+061F: "؟" ARABIC QUESTION MARK // U+060C: "،" ARABIC COMMA // U+061B: "؛" ARABIC SEMICOLON - /* 48 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\u060C,\u061F,@,&,\\%,+,\u061B,/,(,)", + /* 49 */ "!fixedColumnOrder!8,\",\',#,-,:,!,\u060C,\u061F,@,&,\\%,+,\u061B,/,(,)", // U+2605: "★" BLACK STAR // U+066D: "٭" ARABIC FIVE POINTED STAR - /* 49 */ "\u2605,\u066D", + /* 50 */ "\u2605,\u066D", // U+266A: "♪" EIGHTH NOTE - /* 50 */ "\u266A", - /* 51 */ null, + /* 51 */ "\u266A", + /* 52 */ null, // The all letters need to be mirrored are found at // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt // U+FD3E: "﴾" ORNATE LEFT PARENTHESIS // U+FD3F: "﴿" ORNATE RIGHT PARENTHESIS - /* 52 */ "!fixedColumnOrder!4,\uFD3E|\uFD3F,<|>,{|},[|]", - /* 53 */ "!fixedColumnOrder!4,\uFD3F|\uFD3E,>|<,}|{,]|[", + /* 53 */ "!fixedColumnOrder!4,\uFD3E|\uFD3F,<|>,{|},[|]", + /* 54 */ "!fixedColumnOrder!4,\uFD3F|\uFD3E,>|<,}|{,]|[", // U+2264: "≤" LESS-THAN OR EQUAL TO // U+2265: "≥" GREATER-THAN EQUAL TO // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -1249,8 +1310,8 @@ public final class KeyboardTextsSet { // U+201D: "”" RIGHT DOUBLE QUOTATION MARK // U+201E: "„" DOUBLE LOW-9 QUOTATION MARK // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK - /* 54 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,<|>", - /* 55 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,>|<", + /* 55 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,<|>", + /* 56 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,>|<", // U+0655: "ٕ" ARABIC HAMZA BELOW // U+0652: "ْ" ARABIC SUKUN // U+0651: "ّ" ARABIC SHADDA @@ -1266,68 +1327,74 @@ public final class KeyboardTextsSet { // U+064E: "َ" ARABIC FATHA // U+0640: "ـ" ARABIC TATWEEL // In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. - /* 56 */ "!fixedColumnOrder!7,\u0655,\u0652,\u0651,\u064C,\u064D,\u064B,\u0654,\u0656,\u0670,\u0653,\u064F,\u0650,\u064E,\u0640\u0640\u0640|\u0640", - /* 57 */ "\u064B", + /* 57 */ "!fixedColumnOrder!7,\u0655,\u0652,\u0651,\u064C,\u064D,\u064B,\u0654,\u0656,\u0670,\u0653,\u064F,\u0650,\u064E,\u0640\u0640\u0640|\u0640", + /* 58 */ "\u064B", // U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE - /* 58 */ "\u06F1", + /* 59 */ "\u06F1", // U+06F2: "۲" EXTENDED ARABIC-INDIC DIGIT TWO - /* 59 */ "\u06F2", + /* 60 */ "\u06F2", // U+06F3: "۳" EXTENDED ARABIC-INDIC DIGIT THREE - /* 60 */ "\u06F3", + /* 61 */ "\u06F3", // U+06F4: "۴" EXTENDED ARABIC-INDIC DIGIT FOUR - /* 61 */ "\u06F4", + /* 62 */ "\u06F4", // U+06F5: "۵" EXTENDED ARABIC-INDIC DIGIT FIVE - /* 62 */ "\u06F5", + /* 63 */ "\u06F5", // U+06F6: "۶" EXTENDED ARABIC-INDIC DIGIT SIX - /* 63 */ "\u06F6", + /* 64 */ "\u06F6", // U+06F7: "۷" EXTENDED ARABIC-INDIC DIGIT SEVEN - /* 64 */ "\u06F7", + /* 65 */ "\u06F7", // U+06F8: "۸" EXTENDED ARABIC-INDIC DIGIT EIGHT - /* 65 */ "\u06F8", + /* 66 */ "\u06F8", // U+06F9: "۹" EXTENDED ARABIC-INDIC DIGIT NINE - /* 66 */ "\u06F9", + /* 67 */ "\u06F9", // U+06F0: "۰" EXTENDED ARABIC-INDIC DIGIT ZERO - /* 67 */ "\u06F0", - /* 68 */ "1", - /* 69 */ "2", - /* 70 */ "3", - /* 71 */ "4", - /* 72 */ "5", - /* 73 */ "6", - /* 74 */ "7", - /* 75 */ "8", - /* 76 */ "9", + /* 68 */ "\u06F0", + // Label for "switch to symbols" key. + // U+061F: "؟" ARABIC QUESTION MARK + /* 69 */ "\u06F3\u06F2\u06F1\u061F", + // Label for "switch to symbols with microphone" key. This string shouldn't include the "mic" + // part because it'll be appended by the code. + /* 70 */ "\u06F3\u06F2\u06F1", + /* 71 */ "1", + /* 72 */ "2", + /* 73 */ "3", + /* 74 */ "4", + /* 75 */ "5", + /* 76 */ "6", + /* 77 */ "7", + /* 78 */ "8", + /* 79 */ "9", // U+066B: "٫" ARABIC DECIMAL SEPARATOR // U+066C: "٬" ARABIC THOUSANDS SEPARATOR - /* 77 */ "0,\u066B,\u066C", - /* 78~ */ + /* 80 */ "0,\u066B,\u066C", + /* 81~ */ null, null, null, null, null, null, null, null, null, null, - /* ~87 */ + /* ~90 */ // U+060C: "،" ARABIC COMMA - /* 88 */ "\u060C", - /* 89 */ "\\,", - /* 90 */ "\u061F", - /* 91 */ "\u061B", + /* 91 */ "\u060C", + /* 92 */ "\\,", + /* 93 */ "\u061F", + /* 94 */ "\u061B", // U+066A: "٪" ARABIC PERCENT SIGN - /* 92 */ "\u066A", - /* 93 */ null, - /* 94 */ "?", - /* 95 */ ";", + /* 95 */ "\u066A", + /* 96 */ null, + /* 97 */ "?", + /* 98 */ ";", // U+2030: "‰" PER MILLE SIGN - /* 96 */ "\\%,\u2030", + /* 99 */ "\\%,\u2030", // U+060C: "،" ARABIC COMMA // U+061B: "؛" ARABIC SEMICOLON // U+061F: "؟" ARABIC QUESTION MARK // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK // U+00BB: "»" RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - /* 97 */ "\u060C", - /* 98 */ "!", - /* 99 */ "!,\\,", - /* 100 */ "\u061F", - /* 101 */ "\u061F,?", - /* 102 */ "\u060C", + /* 100 */ "\u060C", + /* 101 */ "!", + /* 102 */ "!,\\,", /* 103 */ "\u061F", - /* 104 */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,/,\u00AB|\u00BB,\u00BB|\u00AB", + /* 104 */ "\u061F,?", + /* 105 */ "\u060C", + /* 106 */ "\u061F", + /* 107 */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,/,\u00AB|\u00BB,\u00BB|\u00AB", }; /* Language fi: Finnish */ @@ -1435,44 +1502,56 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, - /* ~45 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0915: "क" DEVANAGARI LETTER KA + // U+0916: "ख" DEVANAGARI LETTER KHA + // U+0917: "ग" DEVANAGARI LETTER GA + /* 42 */ "\u0915\u0916\u0917", + /* 43~ */ + null, null, null, null, + /* ~46 */ // U+20B9: "₹" INDIAN RUPEE SIGN - /* 46 */ "\u20B9", - /* 47~ */ + /* 47 */ "\u20B9", + /* 48~ */ null, null, null, null, null, null, null, null, null, null, null, - /* ~57 */ + /* ~58 */ // U+0967: "१" DEVANAGARI DIGIT ONE - /* 58 */ "\u0967", + /* 59 */ "\u0967", // U+0968: "२" DEVANAGARI DIGIT TWO - /* 59 */ "\u0968", + /* 60 */ "\u0968", // U+0969: "३" DEVANAGARI DIGIT THREE - /* 60 */ "\u0969", + /* 61 */ "\u0969", // U+096A: "४" DEVANAGARI DIGIT FOUR - /* 61 */ "\u096A", + /* 62 */ "\u096A", // U+096B: "५" DEVANAGARI DIGIT FIVE - /* 62 */ "\u096B", + /* 63 */ "\u096B", // U+096C: "६" DEVANAGARI DIGIT SIX - /* 63 */ "\u096C", + /* 64 */ "\u096C", // U+096D: "७" DEVANAGARI DIGIT SEVEN - /* 64 */ "\u096D", + /* 65 */ "\u096D", // U+096E: "८" DEVANAGARI DIGIT EIGHT - /* 65 */ "\u096E", + /* 66 */ "\u096E", // U+096F: "९" DEVANAGARI DIGIT NINE - /* 66 */ "\u096F", + /* 67 */ "\u096F", // U+0966: "०" DEVANAGARI DIGIT ZERO - /* 67 */ "\u0966", - /* 68 */ "1", - /* 69 */ "2", - /* 70 */ "3", - /* 71 */ "4", - /* 72 */ "5", - /* 73 */ "6", - /* 74 */ "7", - /* 75 */ "8", - /* 76 */ "9", - /* 77 */ "0", + /* 68 */ "\u0966", + // Label for "switch to symbols" key. + /* 69 */ "?\u0967\u0968\u0969", + // Label for "switch to symbols with microphone" key. This string shouldn't include the "mic" + // part because it'll be appended by the code. + /* 70 */ "\u0967\u0968\u0969", + /* 71 */ "1", + /* 72 */ "2", + /* 73 */ "3", + /* 74 */ "4", + /* 75 */ "5", + /* 76 */ "6", + /* 77 */ "7", + /* 78 */ "8", + /* 79 */ "9", + /* 80 */ "0", }; /* Language hr: Croatian */ @@ -1660,29 +1739,35 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~42 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+05D0: "א" HEBREW LETTER ALEF + // U+05D1: "ב" HEBREW LETTER BET + // U+05D2: "ג" HEBREW LETTER GIMEL + /* 42 */ "\u05D0\u05D1\u05D2", + /* 43 */ null, // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_double_quote">“,”,„,‟,«|»,»|«</string> - /* 43 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB", + /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«|»,»|«;,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", - /* 45 */ null, + /* 45 */ "!fixedColumnOrder!4,\u201C,\u201D,\u00AB|\u00BB,\u00BB|\u00AB,\u2018,\u2019,\u201A,\u201B", + /* 46 */ null, // U+20AA: "₪" NEW SHEQEL SIGN - /* 46 */ "\u20AA", - /* 47 */ null, + /* 47 */ "\u20AA", /* 48 */ null, + /* 49 */ null, // U+2605: "★" BLACK STAR - /* 49 */ "\u2605", - /* 50 */ null, + /* 50 */ "\u2605", + /* 51 */ null, // U+00B1: "±" PLUS-MINUS SIGN // U+FB29: "﬩" HEBREW LETTER ALTERNATIVE PLUS SIGN - /* 51 */ "\u00B1,\uFB29", + /* 52 */ "\u00B1,\uFB29", // The all letters need to be mirrored are found at // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt - /* 52 */ "!fixedColumnOrder!3,<|>,{|},[|]", - /* 53 */ "!fixedColumnOrder!3,>|<,}|{,]|[", + /* 53 */ "!fixedColumnOrder!3,<|>,{|},[|]", + /* 54 */ "!fixedColumnOrder!3,>|<,}|{,]|[", // U+2264: "≤" LESS-THAN OR EQUAL TO // U+2265: "≥" GREATER-THAN EQUAL TO // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -1698,8 +1783,22 @@ public final class KeyboardTextsSet { // U+201D: "”" RIGHT DOUBLE QUOTATION MARK // U+201E: "„" DOUBLE LOW-9 QUOTATION MARK // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK - /* 54 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", - /* 55 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", + /* 55 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", + /* 56 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", + }; + + /* Language ka: Georgian */ + private static final String[] LANGUAGE_ka = { + /* 0~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+10D0: "ა" GEORGIAN LETTER AN + // U+10D1: "ბ" GEORGIAN LETTER BAN + // U+10D2: "გ" GEORGIAN LETTER GAN + /* 42 */ "\u10D0\u10D1\u10D2", }; /* Language ky: Kirghiz */ @@ -1733,6 +1832,12 @@ public final class KeyboardTextsSet { /* ~39 */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* 40 */ "\u0451", + /* 41 */ null, + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", }; /* Language lt: Lithuanian */ @@ -1933,7 +2038,12 @@ public final class KeyboardTextsSet { /* 40 */ "\u0450", // U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE /* 41 */ "\u045D", - /* 42 */ null, + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", + /* 43 */ null, // U+2018: "‘" LEFT SINGLE QUOTATION MARK // U+2019: "’" RIGHT SINGLE QUOTATION MARK // U+201A: "‚" SINGLE LOW-9 QUOTATION MARK @@ -1944,10 +2054,10 @@ public final class KeyboardTextsSet { // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_double_quote">!fixedColumnOrder!6,„,“,”,‟,«,»</string> - /* 43 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB", + /* 44 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", + /* 45 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", }; /* Language mn: Mongolian */ @@ -1955,11 +2065,18 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, - /* ~45 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", + /* 43~ */ + null, null, null, null, + /* ~46 */ // U+20AE: "₮" TUGRIK SIGN - /* 46 */ "\u20AE", + /* 47 */ "\u20AE", }; /* Language nb: Norwegian Bokmål */ @@ -2239,6 +2356,12 @@ public final class KeyboardTextsSet { /* ~39 */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* 40 */ "\u0451", + /* 41 */ null, + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", }; /* Language sk: Slovak */ @@ -2388,8 +2511,13 @@ public final class KeyboardTextsSet { /* 40 */ "\u0450", // U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE /* 41 */ "\u045D", - /* 42 */ null, // END: More keys definitions for Serbian (Cyrillic) + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", + /* 43 */ null, // U+2018: "‘" LEFT SINGLE QUOTATION MARK // U+2019: "’" RIGHT SINGLE QUOTATION MARK // U+201A: "‚" SINGLE LOW-9 QUOTATION MARK @@ -2400,10 +2528,10 @@ public final class KeyboardTextsSet { // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_double_quote">!fixedColumnOrder!6,„,“,”,‟,«,»</string> - /* 43 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB", + /* 44 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB", // TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. // <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»,‘,’,‚,‛</string> - /* 44 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", + /* 45 */ "!fixedColumnOrder!5,\u201E,\u201C,\u201D,\u00AB,\u00BB,\u2018,\u2019,\u201A,\u201B", }; /* Language sv: Swedish */ @@ -2504,11 +2632,18 @@ public final class KeyboardTextsSet { /* 0~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, - /* ~45 */ + null, null, null, null, null, null, null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0E01: "ก" THAI CHARACTER KO KAI + // U+0E02: "ข" THAI CHARACTER KHO KHAI + // U+0E04: "ค" THAI CHARACTER KHO KHWAI + /* 42 */ "\u0E01\u0E02\u0E04", + /* 43~ */ + null, null, null, null, + /* ~46 */ // U+0E3F: "฿" THAI CURRENCY SYMBOL BAHT - /* 46 */ "\u0E3F", + /* 47 */ "\u0E3F", }; /* Language tl: Tagalog */ @@ -2636,10 +2771,18 @@ public final class KeyboardTextsSet { // U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN /* 35 */ "\u044A", /* 36~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~45 */ + null, null, null, null, null, null, + /* ~41 */ + // Label for "switch to alphabetic" key. + // U+0410: "А" CYRILLIC CAPITAL LETTER A + // U+0411: "Б" CYRILLIC CAPITAL LETTER BE + // U+0412: "В" CYRILLIC CAPITAL LETTER VE + /* 42 */ "\u0410\u0411\u0412", + /* 43~ */ + null, null, null, null, + /* ~46 */ // U+20B4: "₴" HRYVNIA SIGN - /* 46 */ "\u20B4", + /* 47 */ "\u20B4", }; /* Language vi: Vietnamese */ @@ -2724,10 +2867,10 @@ public final class KeyboardTextsSet { /* 10~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, - /* ~45 */ + null, null, null, null, null, null, null, + /* ~46 */ // U+20AB: "₫" DONG SIGN - /* 46 */ "\u20AB", + /* 47 */ "\u20AB", }; /* Language zu: Zulu */ @@ -2905,10 +3048,12 @@ public final class KeyboardTextsSet { "af", LANGUAGE_af, /* Afrikaans */ "ar", LANGUAGE_ar, /* Arabic */ "be", LANGUAGE_be, /* Belarusian */ + "bg", LANGUAGE_bg, /* Bulgarian */ "ca", LANGUAGE_ca, /* Catalan */ "cs", LANGUAGE_cs, /* Czech */ "da", LANGUAGE_da, /* Danish */ "de", LANGUAGE_de, /* German */ + "el", LANGUAGE_el, /* Greek */ "en", LANGUAGE_en, /* English */ "eo", LANGUAGE_eo, /* Esperanto */ "es", LANGUAGE_es, /* Spanish */ @@ -2922,6 +3067,7 @@ public final class KeyboardTextsSet { "is", LANGUAGE_is, /* Icelandic */ "it", LANGUAGE_it, /* Italian */ "iw", LANGUAGE_iw, /* Hebrew */ + "ka", LANGUAGE_ka, /* Georgian */ "ky", LANGUAGE_ky, /* Kirghiz */ "lt", LANGUAGE_lt, /* Lithuanian */ "lv", LANGUAGE_lv, /* Latvian */ diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index dcbbfca09..9d52f3a70 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -824,6 +824,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestionStrip(); + resetComposingState(true /* alsoResetLastComposedWord */); } @Override diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java index fb1eb2701..f1a7e97e8 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java @@ -1412,8 +1412,6 @@ public final class BinaryDictInputOutput { private static WeightedString getWordAtAddressWithParentAddress( final FusionDictionaryBufferInterface buffer, final int headerSize, final int address, final FormatOptions options) { - final StringBuilder builder = new StringBuilder(); - int currentAddress = address; int index = FormatSpec.MAX_WORD_LENGTH - 1; int frequency = Integer.MIN_VALUE; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index 2f146f86c..89d6c9010 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -294,6 +294,8 @@ public final class AndroidSpellCheckerService extends SpellCheckerService final String[] gatheredSuggestions; final boolean hasRecommendedSuggestions; if (0 == mLength) { + // TODO: the comment below describes what is intended, but in the practice + // mBestSuggestion is only ever set to null so it doesn't work. Fix this. // Either we found no suggestions, or we found some BUT the max length was 0. // If we found some mBestSuggestion will not be null. If it is null, then // we found none, regardless of the max length. diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java index f0017c095..26a304ef8 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java @@ -17,66 +17,17 @@ package com.android.inputmethod.latin.suggestions; import android.content.Context; -import android.content.res.Resources; import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; -import com.android.inputmethod.keyboard.KeyboardActionListener; -import com.android.inputmethod.keyboard.KeyboardView; -import com.android.inputmethod.keyboard.MoreKeysDetector; -import com.android.inputmethod.keyboard.MoreKeysPanel; -import com.android.inputmethod.keyboard.PointerTracker; -import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy; -import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler; -import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; -import com.android.inputmethod.latin.CoordinateUtils; +import com.android.inputmethod.keyboard.MoreKeysKeyboardView; import com.android.inputmethod.latin.R; /** * A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting * key presses and touch movements. */ -public final class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel { - private final int[] mCoordinates = CoordinateUtils.newInstance(); - - final KeyDetector mModalPanelKeyDetector; - private final KeyDetector mSlidingPanelKeyDetector; - - private Controller mController; - KeyboardActionListener mListener; - private int mOriginX; - private int mOriginY; - - static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter(); - - final KeyboardActionListener mSuggestionsPaneListener = - new KeyboardActionListener.Adapter() { - @Override - public void onPressKey(final int primaryCode) { - mListener.onPressKey(primaryCode); - } - - @Override - public void onReleaseKey(final int primaryCode, final boolean withSliding) { - mListener.onReleaseKey(primaryCode, withSliding); - } - - @Override - public void onCodeInput(final int primaryCode, final int x, final int y) { - final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE; - if (index >= 0 && index < SuggestionStripView.MAX_SUGGESTIONS) { - mListener.onCustomRequest(index); - } - } - - @Override - public void onCancelInput() { - mListener.onCancelInput(); - } - }; +public final class MoreSuggestionsView extends MoreKeysKeyboardView { public MoreSuggestionsView(final Context context, final AttributeSet attrs) { this(context, attrs, R.attr.moreSuggestionsViewStyle); @@ -85,12 +36,12 @@ public final class MoreSuggestionsView extends KeyboardView implements MoreKeysP public MoreSuggestionsView(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); + } - final Resources res = context.getResources(); - mModalPanelKeyDetector = new KeyDetector(/* keyHysteresisDistance */ 0); - mSlidingPanelKeyDetector = new MoreKeysDetector( - res.getDimension(R.dimen.more_suggestions_slide_allowance)); - setKeyPreviewPopupEnabled(false, 0); + @Override + protected int getDefaultCoordX() { + final MoreSuggestions pane = (MoreSuggestions)getKeyboard(); + return pane.mOccupiedWidth / 2; } @Override @@ -110,119 +61,11 @@ public final class MoreSuggestionsView extends KeyboardView implements MoreKeysP } @Override - public void setKeyboard(final Keyboard keyboard) { - super.setKeyboard(keyboard); - mModalPanelKeyDetector.setKeyboard(keyboard, -getPaddingLeft(), -getPaddingTop()); - mSlidingPanelKeyDetector.setKeyboard(keyboard, -getPaddingLeft(), - -getPaddingTop() + mVerticalCorrection); - } - - @Override - public KeyDetector getKeyDetector() { - return mSlidingPanelKeyDetector; - } - - @Override - public KeyboardActionListener getKeyboardActionListener() { - return mSuggestionsPaneListener; - } - - @Override - public DrawingProxy getDrawingProxy() { - return this; - } - - @Override - public TimerProxy getTimerProxy() { - return EMPTY_TIMER_PROXY; - } - - @Override - public void setKeyPreviewPopupEnabled(final boolean previewEnabled, final int delay) { - // Suggestions pane needs no pop-up key preview displayed, so we pass always false with a - // delay of 0. The delay does not matter actually since the popup is not shown anyway. - super.setKeyPreviewPopupEnabled(false, 0); - } - - @Override - public void showMoreKeysPanel(final View parentView, final Controller controller, - final int pointX, final int pointY, final KeyboardActionListener listener) { - mController = controller; - mListener = listener; - final View container = getContainerView(); - final MoreSuggestions pane = (MoreSuggestions)getKeyboard(); - final int defaultCoordX = pane.mOccupiedWidth / 2; - // The coordinates of panel's left-top corner in parentView's coordinate system. - final int x = pointX - defaultCoordX - container.getPaddingLeft(); - final int y = pointY - container.getMeasuredHeight() + container.getPaddingBottom(); - - parentView.getLocationInWindow(mCoordinates); - // Ensure the horizontal position of the panel does not extend past the screen edges. - final int maxX = parentView.getMeasuredWidth() - container.getMeasuredWidth(); - final int panelX = Math.max(0, Math.min(maxX, x + CoordinateUtils.x(mCoordinates))); - final int panelY = y + CoordinateUtils.y(mCoordinates); - container.setX(panelX); - container.setY(panelY); - - mOriginX = x + container.getPaddingLeft(); - mOriginY = y + container.getPaddingTop(); - controller.onShowMoreKeysPanel(this); - } - - @Override - public boolean dismissMoreKeysPanel() { - if (mController == null) return false; - return mController.onDismissMoreKeysPanel(); - } - - @Override - public int translateX(final int x) { - return x - mOriginX; - } - - @Override - public int translateY(final int y) { - return y - mOriginY; - } - - private final KeyEventHandler mModalPanelKeyEventHandler = new KeyEventHandler() { - @Override - public KeyDetector getKeyDetector() { - return mModalPanelKeyDetector; - } - - @Override - public KeyboardActionListener getKeyboardActionListener() { - return mSuggestionsPaneListener; - } - - @Override - public DrawingProxy getDrawingProxy() { - return MoreSuggestionsView.this; + public void onCodeInput(final int primaryCode, final int x, final int y) { + final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE; + if (index >= 0 && index < SuggestionStripView.MAX_SUGGESTIONS) { + mListener.onCustomRequest(index); } - - @Override - public TimerProxy getTimerProxy() { - return EMPTY_TIMER_PROXY; - } - }; - - @Override - public boolean onTouchEvent(final MotionEvent me) { - 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, this); - final int x = (int)me.getX(index); - final int y = (int)me.getY(index); - tracker.processMotionEvent(action, x, y, eventTime, mModalPanelKeyEventHandler); - return true; - } - - @Override - public View getContainerView() { - return (View)getParent(); } @Override diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java index e27fc2a7a..d7b514e8a 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java @@ -54,7 +54,6 @@ import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.MoreKeysPanel; -import com.android.inputmethod.keyboard.PointerTracker; import com.android.inputmethod.keyboard.ViewLayoutUtils; import com.android.inputmethod.latin.AutoCorrection; import com.android.inputmethod.latin.CollectionUtils; @@ -685,6 +684,11 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick public void onShowMoreKeysPanel(MoreKeysPanel panel) { mKeyboardView.onShowMoreKeysPanel(panel); } + + @Override + public void onCancelMoreKeysPanel() { + dismissMoreSuggestions(); + } }; boolean dismissMoreSuggestions() { @@ -771,7 +775,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick final long eventTime = me.getEventTime(); final int index = me.getActionIndex(); final int id = me.getPointerId(index); - 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); @@ -783,7 +786,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick // Decided to be in the sliding input mode only when the touch point has been moved // upward. mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_SLIDING_MODE; - tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel); } 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; @@ -792,7 +794,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick } // MORE_SUGGESTIONS_IN_SLIDING_MODE - tracker.processMotionEvent(action, translatedX, translatedY, eventTime, moreKeysPanel); + mMoreSuggestionsView.processMotionEvent(action, translatedX, translatedY, id, eventTime); return true; } |