aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java41
-rw-r--r--java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java8
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java17
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java25
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java26
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/CustomViewPager.java47
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/DrawingPreviewPlacerView.java2
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/GestureTrailsDrawingPreview.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java3
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java457
-rw-r--r--java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java3
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java22
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java90
-rw-r--r--java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java11
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java22
-rw-r--r--java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java4
-rw-r--r--java/src/com/android/inputmethod/latin/utils/DialogUtils.java34
17 files changed, 417 insertions, 399 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
index 8badaf4b9..4a8fa51ee 100644
--- a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
+++ b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
@@ -45,10 +45,8 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
// This is the first released version of the database that implements CLIENTID. It is
// used to identify the versions for upgrades. This should never change going forward.
private static final int METADATA_DATABASE_VERSION_WITH_CLIENTID = 6;
- // This is the current database version. It should be updated when the database schema
- // gets updated. It is passed to the framework constructor of SQLiteOpenHelper, so
- // that's what the framework uses to track our database version.
- private static final int METADATA_DATABASE_VERSION = 6;
+ // The current database version.
+ private static final int CURRENT_METADATA_DATABASE_VERSION = 7;
private final static long NOT_A_DOWNLOAD_ID = -1;
@@ -169,7 +167,7 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
private MetadataDbHelper(final Context context, final String clientId) {
super(context,
METADATA_DATABASE_NAME_STEM + (TextUtils.isEmpty(clientId) ? "" : "." + clientId),
- null, METADATA_DATABASE_VERSION);
+ null, CURRENT_METADATA_DATABASE_VERSION);
mContext = context;
mClientId = clientId;
}
@@ -219,22 +217,45 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
/**
* Upgrade the database. Upgrade from version 3 is supported.
+ * Version 3 has a DB named METADATA_DATABASE_NAME_STEM containing a table METADATA_TABLE_NAME.
+ * Version 6 and above has a DB named METADATA_DATABASE_NAME_STEM containing a
+ * table CLIENT_TABLE_NAME, and for each client a table called METADATA_TABLE_STEM + "." + the
+ * name of the client and contains a table METADATA_TABLE_NAME.
+ * For schemas, see the above create statements. The schemas have never changed so far.
+ *
+ * This method is called by the framework. See {@link SQLiteOpenHelper#onUpgrade}
+ * @param db The database we are upgrading
+ * @param oldVersion The old database version (the one on the disk)
+ * @param newVersion The new database version as supplied to the constructor of SQLiteOpenHelper
*/
@Override
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
if (METADATA_DATABASE_INITIAL_VERSION == oldVersion
- && METADATA_DATABASE_VERSION_WITH_CLIENTID == newVersion) {
+ && METADATA_DATABASE_VERSION_WITH_CLIENTID <= newVersion
+ && CURRENT_METADATA_DATABASE_VERSION >= newVersion) {
// Upgrade from version METADATA_DATABASE_INITIAL_VERSION to version
// METADATA_DATABASE_VERSION_WITH_CLIENT_ID
+ // Only the default database should contain the client table, so we test for mClientId.
if (TextUtils.isEmpty(mClientId)) {
- // Only the default database should contain the client table.
- // Anyway in version 3 only the default table existed so the emptyness
+ // Anyway in version 3 only the default table existed so the emptiness
// test should always be true, but better check to be sure.
createClientTable(db);
}
+ } else if (METADATA_DATABASE_VERSION_WITH_CLIENTID < newVersion
+ && CURRENT_METADATA_DATABASE_VERSION >= newVersion) {
+ // Here we drop the client table, so that all clients send us their information again.
+ // The client table contains the URL to hit to update the available dictionaries list,
+ // but the info about the dictionaries themselves is stored in the table called
+ // METADATA_TABLE_NAME and we want to keep it, so we only drop the client table.
+ db.execSQL("DROP TABLE IF EXISTS " + CLIENT_TABLE_NAME);
+ // Only the default database should contain the client table, so we test for mClientId.
+ if (TextUtils.isEmpty(mClientId)) {
+ createClientTable(db);
+ }
} else {
- // Version 3 was the earliest version, so we should never come here. If we do, we
- // have no idea what this database is, so we'd better wipe it off.
+ // If we're not in the above case, either we are upgrading from an earlier versionCode
+ // and we should wipe the database, or we are handling a version we never heard about
+ // (can only be a bug) so it's safer to wipe the database.
db.execSQL("DROP TABLE IF EXISTS " + METADATA_TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + CLIENT_TABLE_NAME);
onCreate(db);
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index 7e2166769..4edc61690 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -518,6 +518,14 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
}
@Override
+ public boolean dispatchTouchEvent(final MotionEvent ev) {
+ // Add here to the stack trace to nail down the {@link IllegalArgumentException} exception
+ // in MotionEvent that sporadically happens.
+ // TODO: Remove this override method once the issue has been addressed.
+ return super.dispatchTouchEvent(ev);
+ }
+
+ @Override
public void onTabChanged(final String tabId) {
final int categoryId = mEmojiCategory.getCategoryId(tabId);
setCurrentCategoryId(categoryId, false /* force */);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index fd0be6f92..2e4a0902d 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -219,22 +219,15 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
return null;
}
- /**
- * Update keyboard shift state triggered by connected EditText status change.
- */
- public void updateShiftState() {
- mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState(),
- mLatinIME.getCurrentRecapitalizeState());
- }
-
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
public void resetKeyboardStateToAlphabet() {
mState.onResetKeyboardStateToAlphabet();
}
- public void onPressKey(final int code, final boolean isSinglePointer) {
- mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState());
+ public void onPressKey(final int code, final boolean isSinglePointer,
+ final int currentAutoCapsState) {
+ mState.onPressKey(code, isSinglePointer, currentAutoCapsState);
}
public void onReleaseKey(final int code, final boolean withSliding) {
@@ -338,8 +331,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
/**
* Updates state machine to figure out when to automatically switch back to the previous mode.
*/
- public void onCodeInput(final int code) {
- mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
+ public void onCodeInput(final int code, final int currentAutoCapsState) {
+ mState.onCodeInput(code, currentAutoCapsState);
}
public boolean isShowingEmojiPalettes() {
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 0f9c39a80..d8dd93a35 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -30,7 +30,6 @@ import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
-import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -428,21 +427,11 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
}
private void locatePreviewPlacerView() {
- if (mDrawingPreviewPlacerView.getParent() != null) {
- return;
- }
- final int width = getWidth();
- final int height = getHeight();
- if (width == 0 || height == 0) {
- // In transient state.
- return;
- }
getLocationInWindow(mOriginCoords);
- final DisplayMetrics dm = getResources().getDisplayMetrics();
- if (CoordinateUtils.y(mOriginCoords) < dm.heightPixels / 4) {
- // In transient state.
- return;
- }
+ mDrawingPreviewPlacerView.setKeyboardViewGeometry(mOriginCoords, getWidth(), getHeight());
+ }
+
+ private void installPreviewPlacerView() {
final View rootView = getRootView();
if (rootView == null) {
Log.w(TAG, "Cannot find root view");
@@ -452,10 +441,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
// Note: It'd be very weird if we get null by android.R.id.content.
if (windowContentView == null) {
Log.w(TAG, "Cannot find android.R.id.content view to add DrawingPreviewPlacerView");
- } else {
- windowContentView.addView(mDrawingPreviewPlacerView);
- mDrawingPreviewPlacerView.setKeyboardViewGeometry(mOriginCoords, width, height);
+ return;
}
+ windowContentView.addView(mDrawingPreviewPlacerView);
}
/**
@@ -576,6 +564,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
+ installPreviewPlacerView();
// Notify the ResearchLogger (development only diagnostics) that the keyboard view has
// been attached. This is needed to properly show the splash screen, which requires that
// the window token of the KeyboardView be non-null.
diff --git a/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java b/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
index cd7dd6f18..3a72aed0d 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/AbstractDrawingPreview.java
@@ -29,25 +29,37 @@ import com.android.inputmethod.keyboard.PointerTracker;
public abstract class AbstractDrawingPreview {
private final View mDrawingView;
private boolean mPreviewEnabled;
+ private boolean mHasValidGeometry;
protected AbstractDrawingPreview(final View drawingView) {
mDrawingView = drawingView;
}
- public final View getDrawingView() {
+ protected final View getDrawingView() {
return mDrawingView;
}
- public final void setPreviewEnabled(final boolean enabled) {
- mPreviewEnabled = enabled;
+ protected final boolean isPreviewEnabled() {
+ return mPreviewEnabled && mHasValidGeometry;
}
- public boolean isPreviewEnabled() {
- return mPreviewEnabled;
+ public final void setPreviewEnabled(final boolean enabled) {
+ mPreviewEnabled = enabled;
}
- public void setKeyboardGeometry(final int[] originCoords, final int width, final int height) {
- // Default implementation is empty.
+ /**
+ * Set {@link MainKeyboardView} geometry and position in the {@link SoftInputWindow}.
+ * The class that is overriding this method must call this super implementation.
+ *
+ * @param originCoords the top-left coordinates of the {@link MainKeyboardView} in
+ * {@link SoftInputWindow} coordinate-system. This is unused but has a point in an
+ * extended class, such as {@link GestureTrailsDrawingPreview}.
+ * @param width the width of {@link MainKeyboardView}.
+ * @param height the height of {@link MainKeyboardView}.
+ */
+ public void setKeyboardViewGeometry(final int[] originCoords, final int width,
+ final int height) {
+ mHasValidGeometry = (width > 0 && height > 0);
}
public abstract void onDeallocateMemory();
diff --git a/java/src/com/android/inputmethod/keyboard/internal/CustomViewPager.java b/java/src/com/android/inputmethod/keyboard/internal/CustomViewPager.java
deleted file mode 100644
index f5cc45ca7..000000000
--- a/java/src/com/android/inputmethod/keyboard/internal/CustomViewPager.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.inputmethod.keyboard.internal;
-
-import android.content.Context;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.MotionEvent;
-
-/**
- * Custom view pager to prevent {@link ViewPager} from crashing while handling multi-touch
- * event.
- */
-public class CustomViewPager extends ViewPager {
- private static final String TAG = CustomViewPager.class.getSimpleName();
-
- public CustomViewPager(final Context context, final AttributeSet attrs) {
- super(context, attrs);
- }
-
- @Override
- public boolean onInterceptTouchEvent(final MotionEvent event) {
- // This only happens when you multi-touch, take the first finger off and move.
- // Unfortunately this causes {@link ViewPager} to crash, so we will ignore such events.
- if (event.getAction() == MotionEvent.ACTION_MOVE && event.getPointerId(0) != 0) {
- Log.w(TAG, "Ignored multi-touch move event to prevent ViewPager from crashing");
- return false;
- }
-
- return super.onInterceptTouchEvent(event);
- }
-}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/DrawingPreviewPlacerView.java b/java/src/com/android/inputmethod/keyboard/internal/DrawingPreviewPlacerView.java
index 606addcc4..fdc2458d4 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/DrawingPreviewPlacerView.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/DrawingPreviewPlacerView.java
@@ -55,7 +55,7 @@ public final class DrawingPreviewPlacerView extends RelativeLayout {
CoordinateUtils.copy(mKeyboardViewOrigin, originCoords);
final int count = mPreviews.size();
for (int i = 0; i < count; i++) {
- mPreviews.get(i).setKeyboardGeometry(originCoords, width, height);
+ mPreviews.get(i).setKeyboardViewGeometry(originCoords, width, height);
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsDrawingPreview.java b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsDrawingPreview.java
index eef4b36ed..d8b00c707 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsDrawingPreview.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsDrawingPreview.java
@@ -95,7 +95,9 @@ public final class GestureTrailsDrawingPreview extends AbstractDrawingPreview {
}
@Override
- public void setKeyboardGeometry(final int[] originCoords, final int width, final int height) {
+ public void setKeyboardViewGeometry(final int[] originCoords, final int width,
+ final int height) {
+ super.setKeyboardViewGeometry(originCoords, width, height);
mOffscreenOffsetY = (int)(height
* GestureStrokeRecognitionPoints.EXTRA_GESTURE_TRAIL_AREA_ABOVE_KEYBOARD_RATIO);
mOffscreenWidth = width;
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java
index 56acdde8d..0047aa4a1 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java
@@ -41,8 +41,7 @@ public final class KeyboardTextsSet {
private HashMap<String, String> mResourceNameToTextsMap = CollectionUtils.newHashMap();
public void setLocale(final Locale locale, final Context context) {
- final String language = locale.getLanguage();
- mTextsTable = KeyboardTextsTable.getTextsTable(language);
+ mTextsTable = KeyboardTextsTable.getTextsTable(locale);
final Resources res = context.getResources();
final int referenceId = context.getApplicationInfo().labelRes;
final String resourcePackageName = res.getResourcePackageName(referenceId);
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
index fc67f0879..1bd98332f 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
@@ -19,6 +19,7 @@ package com.android.inputmethod.keyboard.internal;
import com.android.inputmethod.latin.utils.CollectionUtils;
import java.util.HashMap;
+import java.util.Locale;
/**
* !!!!! DO NOT EDIT THIS FILE !!!!!
@@ -44,19 +45,19 @@ import java.util.HashMap;
public final class KeyboardTextsTable {
// Name to index map.
private static final HashMap<String, Integer> sNameToIndexesMap = CollectionUtils.newHashMap();
- // Language to texts table map.
- private static final HashMap<String, String[]> sLanguageToTextsTableMap =
+ // Locale to texts table map.
+ private static final HashMap<String, String[]> sLocaleToTextsTableMap =
CollectionUtils.newHashMap();
// TODO: Remove this variable after debugging.
- // Texts table to language maps.
- private static final HashMap<String[], String> sTextsTableToLanguageMap =
+ // Texts table to locale maps.
+ private static final HashMap<String[], String> sTextsTableToLocaleMap =
CollectionUtils.newHashMap();
public static String getText(final String name, final String[] textsTable) {
final Integer indexObj = sNameToIndexesMap.get(name);
if (indexObj == null) {
- throw new RuntimeException("Unknown text name=" + name + " language="
- + sTextsTableToLanguageMap.get(textsTable));
+ throw new RuntimeException("Unknown text name=" + name + " locale="
+ + sTextsTableToLocaleMap.get(textsTable));
}
final int index = indexObj;
final String text = (index < textsTable.length) ? textsTable[index] : null;
@@ -64,17 +65,24 @@ public final class KeyboardTextsTable {
return text;
}
// Sanity check.
- if (index >= 0 && index < LANGUAGE_DEFAULT.length) {
- return LANGUAGE_DEFAULT[index];
+ if (index >= 0 && index < TEXTS_DEFAULT.length) {
+ return TEXTS_DEFAULT[index];
}
// Throw exception for debugging purpose.
throw new RuntimeException("Illegal index=" + index + " for name=" + name
- + " language=" + sTextsTableToLanguageMap.get(textsTable));
+ + " locale=" + sTextsTableToLocaleMap.get(textsTable));
}
- public static String[] getTextsTable(final String language) {
- final String[] textsTable = sLanguageToTextsTableMap.get(language);
- return textsTable != null ? textsTable : LANGUAGE_DEFAULT;
+ public static String[] getTextsTable(final Locale locale) {
+ final String localeKey = locale.toString();
+ if (sLocaleToTextsTableMap.containsKey(localeKey)) {
+ return sLocaleToTextsTableMap.get(localeKey);
+ }
+ final String languageKey = locale.getLanguage();
+ if (sLocaleToTextsTableMap.containsKey(languageKey)) {
+ return sLocaleToTextsTableMap.get(languageKey);
+ }
+ return TEXTS_DEFAULT;
}
private static final String[] NAMES = {
@@ -188,23 +196,23 @@ public final class KeyboardTextsTable {
/* 106: 2 */ "morekeys_symbols_percent",
/* 107: 1 */ "morekeys_v",
/* 108: 1 */ "morekeys_j",
- /* 109: 1 */ "morekeys_east_slavic_row2_11",
- /* 110: 1 */ "morekeys_cyrillic_ka",
- /* 111: 1 */ "morekeys_cyrillic_a",
- /* 112: 1 */ "morekeys_currency_dollar",
- /* 113: 1 */ "morekeys_tablet_punctuation",
- /* 114: 1 */ "morekeys_plus",
- /* 115: 1 */ "morekeys_less_than",
- /* 116: 1 */ "morekeys_greater_than",
- /* 117: 1 */ "keyspec_period",
- /* 118: 1 */ "keyspec_tablet_period",
- /* 119: 1 */ "morekeys_exclamation",
- /* 120: 1 */ "morekeys_q",
- /* 121: 1 */ "morekeys_x",
- /* 122: 1 */ "keyspec_q",
- /* 123: 1 */ "keyspec_w",
- /* 124: 1 */ "keyspec_y",
- /* 125: 1 */ "keyspec_x",
+ /* 109: 1 */ "morekeys_q",
+ /* 110: 1 */ "morekeys_x",
+ /* 111: 1 */ "keyspec_q",
+ /* 112: 1 */ "keyspec_w",
+ /* 113: 1 */ "keyspec_y",
+ /* 114: 1 */ "keyspec_x",
+ /* 115: 1 */ "morekeys_east_slavic_row2_11",
+ /* 116: 1 */ "morekeys_cyrillic_ka",
+ /* 117: 1 */ "morekeys_cyrillic_a",
+ /* 118: 1 */ "morekeys_currency_dollar",
+ /* 119: 1 */ "morekeys_tablet_punctuation",
+ /* 120: 1 */ "morekeys_plus",
+ /* 121: 1 */ "morekeys_less_than",
+ /* 122: 1 */ "morekeys_greater_than",
+ /* 123: 1 */ "keyspec_period",
+ /* 124: 1 */ "keyspec_tablet_period",
+ /* 125: 1 */ "morekeys_exclamation",
/* 126: 0 */ "morekeys_currency",
/* 127: 0 */ "morekeys_symbols_1",
/* 128: 0 */ "morekeys_symbols_2",
@@ -252,7 +260,7 @@ public final class KeyboardTextsTable {
private static final String EMPTY = "";
/* Default texts */
- private static final String[] LANGUAGE_DEFAULT = {
+ private static final String[] TEXTS_DEFAULT = {
/* morekeys_a ~ */
EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
/* ~ morekeys_c */
@@ -345,7 +353,14 @@ public final class KeyboardTextsTable {
// U+2030: "‰" PER MILLE SIGN
/* morekeys_symbols_percent */ "\u2030",
/* morekeys_v ~ */
- EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
+ EMPTY, EMPTY, EMPTY, EMPTY,
+ /* ~ morekeys_x */
+ /* keyspec_q */ "q",
+ /* keyspec_w */ "w",
+ /* keyspec_y */ "y",
+ /* keyspec_x */ "x",
+ /* morekeys_east_slavic_row2_11 ~ */
+ EMPTY, EMPTY, EMPTY,
/* ~ morekeys_cyrillic_a */
// U+00A2: "¢" CENT SIGN
// U+00A3: "£" POUND SIGN
@@ -363,12 +378,6 @@ public final class KeyboardTextsTable {
/* keyspec_tablet_period */ ".",
// U+00A1: "¡" INVERTED EXCLAMATION MARK
/* morekeys_exclamation */ "\u00A1",
- /* morekeys_q */ EMPTY,
- /* morekeys_x */ EMPTY,
- /* keyspec_q */ "q",
- /* keyspec_w */ "w",
- /* keyspec_y */ "y",
- /* keyspec_x */ "x",
/* morekeys_currency */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1",
// U+00B9: "¹" SUPERSCRIPT ONE
// U+00BD: "½" VULGAR FRACTION ONE HALF
@@ -456,8 +465,8 @@ public final class KeyboardTextsTable {
/* keyspec_emoji_key */ "!icon/emoji_key|!code/key_emoji",
};
- /* Language af: Afrikaans */
- private static final String[] LANGUAGE_af = {
+ /* Locale af: Afrikaans */
+ private static final String[] TEXTS_af = {
// This is the same as Dutch except more keys of y and demoting vowels with diaeresis.
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -512,8 +521,8 @@ public final class KeyboardTextsTable {
/* morekeys_y */ "\u00FD,\u0133",
};
- /* Language ar: Arabic */
- private static final String[] LANGUAGE_ar = {
+ /* Locale ar: Arabic */
+ private static final String[] TEXTS_ar = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -639,8 +648,8 @@ public final class KeyboardTextsTable {
/* morekeys_symbols_percent */ "\\%,\u2030",
};
- /* Language az_AZ: Azerbaijani (Azerbaijan) */
- private static final String[] LANGUAGE_az_AZ = {
+ /* Locale az_AZ: Azerbaijani (Azerbaijan) */
+ private static final String[] TEXTS_az_AZ = {
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
/* morekeys_a */ "\u00E2",
// U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
@@ -687,8 +696,8 @@ public final class KeyboardTextsTable {
/* morekeys_g */ "\u011F",
};
- /* Language be_BY: Belarusian (Belarus) */
- private static final String[] LANGUAGE_be_BY = {
+ /* Locale be_BY: Belarusian (Belarus) */
+ private static final String[] TEXTS_be_BY = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -720,8 +729,8 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_soft_sign */ "\u044A",
};
- /* Language bg: Bulgarian */
- private static final String[] LANGUAGE_bg = {
+ /* Locale bg: Bulgarian */
+ private static final String[] TEXTS_bg = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -736,8 +745,8 @@ public final class KeyboardTextsTable {
/* keylabel_to_alpha */ "\u0410\u0411\u0412",
};
- /* Language ca: Catalan */
- private static final String[] LANGUAGE_ca = {
+ /* Locale ca: Catalan */
+ private static final String[] TEXTS_ca = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
@@ -810,13 +819,13 @@ public final class KeyboardTextsTable {
/* keyspec_spanish_row2_10 */ "\u00E7",
/* morekeys_bullet ~ */
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, null, null, null,
/* ~ morekeys_currency_dollar */
/* morekeys_tablet_punctuation */ "!autoColumnOrder!8,\\,,',\u00B7,#,),(,/,;,@,:,-,\",+,\\%,&",
};
- /* Language cs: Czech */
- private static final String[] LANGUAGE_cs = {
+ /* Locale cs: Czech */
+ private static final String[] TEXTS_cs = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -893,8 +902,8 @@ public final class KeyboardTextsTable {
/* morekeys_r */ "\u0159",
};
- /* Language da: Danish */
- private static final String[] LANGUAGE_da = {
+ /* Locale da: Danish */
+ private static final String[] TEXTS_da = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
@@ -962,8 +971,8 @@ public final class KeyboardTextsTable {
/* morekeys_nordic_row2_11 */ "\u00F6",
};
- /* Language de: German */
- private static final String[] LANGUAGE_de = {
+ /* Locale de: German */
+ private static final String[] TEXTS_de = {
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
@@ -1032,8 +1041,8 @@ public final class KeyboardTextsTable {
/* morekeys_swiss_row2_11 */ "\u00E0",
};
- /* Language el: Greek */
- private static final String[] LANGUAGE_el = {
+ /* Locale el: Greek */
+ private static final String[] TEXTS_el = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -1044,8 +1053,8 @@ public final class KeyboardTextsTable {
/* keylabel_to_alpha */ "\u0391\u0392\u0393",
};
- /* Language en: English */
- private static final String[] LANGUAGE_en = {
+ /* Locale en: English */
+ private static final String[] TEXTS_en = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -1093,8 +1102,8 @@ public final class KeyboardTextsTable {
/* morekeys_s */ "\u00DF",
};
- /* Language eo: Esperanto */
- private static final String[] LANGUAGE_eo = {
+ /* Locale eo: Esperanto */
+ private static final String[] TEXTS_eo = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -1229,9 +1238,7 @@ public final class KeyboardTextsTable {
/* ~ morekeys_symbols_percent */
// U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX
/* morekeys_v */ "w,\u0175",
- /* morekeys_j ~ */
- null, null, null, null, null, null, null, null, null, null, null, null,
- /* ~ morekeys_exclamation */
+ /* morekeys_j */ null,
/* morekeys_q */ "q",
/* morekeys_x */ "x",
// U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX
@@ -1244,8 +1251,8 @@ public final class KeyboardTextsTable {
/* keyspec_x */ "\u0109",
};
- /* Language es: Spanish */
- private static final String[] LANGUAGE_es = {
+ /* Locale es: Spanish */
+ private static final String[] TEXTS_es = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
@@ -1307,8 +1314,8 @@ public final class KeyboardTextsTable {
/* morekeys_punctuation */ "!autoColumnOrder!9,\\,,?,!,#,),(,/,;,\u00A1,',@,:,-,\",+,\\%,&,\u00BF",
};
- /* Language et_EE: Estonian (Estonia) */
- private static final String[] LANGUAGE_et_EE = {
+ /* Locale et_EE: Estonian (Estonia) */
+ private static final String[] TEXTS_et_EE = {
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
@@ -1410,8 +1417,8 @@ public final class KeyboardTextsTable {
/* morekeys_nordic_row2_10 */ "\u00F5",
};
- /* Language eu_ES: Basque (Spain) */
- private static final String[] LANGUAGE_eu_ES = {
+ /* Locale eu_ES: Basque (Spain) */
+ private static final String[] TEXTS_eu_ES = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
@@ -1464,8 +1471,8 @@ public final class KeyboardTextsTable {
/* morekeys_n */ "\u00F1,\u0144",
};
- /* Language fa: Persian */
- private static final String[] LANGUAGE_fa = {
+ /* Locale fa: Persian */
+ private static final String[] TEXTS_fa = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -1590,7 +1597,7 @@ public final class KeyboardTextsTable {
// U+2030: "‰" PER MILLE SIGN
/* morekeys_symbols_percent */ "\\%,\u2030",
/* morekeys_v ~ */
- null, null, null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, null, null, null, null, null,
/* ~ morekeys_plus */
// U+2264: "≤" LESS-THAN OR EQUAL TO
// U+2265: "≥" GREATER-THAN EQUAL TO
@@ -1602,8 +1609,8 @@ public final class KeyboardTextsTable {
/* morekeys_greater_than */ "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than",
};
- /* Language fi: Finnish */
- private static final String[] LANGUAGE_fi = {
+ /* Locale fi: Finnish */
+ private static final String[] TEXTS_fi = {
// U+00E6: "æ" LATIN SMALL LETTER AE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
@@ -1652,8 +1659,8 @@ public final class KeyboardTextsTable {
/* morekeys_nordic_row2_11 */ "\u00E6",
};
- /* Language fr: French */
- private static final String[] LANGUAGE_fr = {
+ /* Locale fr: French */
+ private static final String[] TEXTS_fr = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
// U+00E6: "æ" LATIN SMALL LETTER AE
@@ -1725,8 +1732,8 @@ public final class KeyboardTextsTable {
/* morekeys_swiss_row2_11 */ "\u00E4",
};
- /* Language gl_ES: Gallegan (Spain) */
- private static final String[] LANGUAGE_gl_ES = {
+ /* Locale gl_ES: Gallegan (Spain) */
+ private static final String[] TEXTS_gl_ES = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
@@ -1779,8 +1786,8 @@ public final class KeyboardTextsTable {
/* morekeys_n */ "\u00F1,\u0144",
};
- /* Language hi: Hindi */
- private static final String[] LANGUAGE_hi = {
+ /* Locale hi: Hindi */
+ private static final String[] TEXTS_hi = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -1831,8 +1838,8 @@ public final class KeyboardTextsTable {
/* additional_morekeys_symbols_0 */ "0",
};
- /* Language hr: Croatian */
- private static final String[] LANGUAGE_hr = {
+ /* Locale hr: Croatian */
+ private static final String[] TEXTS_hr = {
/* morekeys_a ~ */
null, null, null, null, null,
/* ~ morekeys_i */
@@ -1864,8 +1871,8 @@ public final class KeyboardTextsTable {
/* double_angle_quotes */ "!text/double_raqm_laqm",
};
- /* Language hu: Hungarian */
- private static final String[] LANGUAGE_hu = {
+ /* Locale hu: Hungarian */
+ private static final String[] TEXTS_hu = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -1918,8 +1925,8 @@ public final class KeyboardTextsTable {
/* double_angle_quotes */ "!text/double_raqm_laqm",
};
- /* Language hy_AM: Armenian (Armenia) */
- private static final String[] LANGUAGE_hy_AM = {
+ /* Locale hy_AM: Armenian (Armenia) */
+ private static final String[] TEXTS_hy_AM = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -1960,7 +1967,8 @@ public final class KeyboardTextsTable {
/* morekeys_h ~ */
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null,
/* ~ morekeys_greater_than */
// U+0589: "։" ARMENIAN FULL STOP
/* keyspec_period */ "\u0589",
@@ -1970,8 +1978,8 @@ public final class KeyboardTextsTable {
/* morekeys_exclamation */ "\u055C,\u00A1",
};
- /* Language is: Icelandic */
- private static final String[] LANGUAGE_is = {
+ /* Locale is: Icelandic */
+ private static final String[] TEXTS_is = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+00E6: "æ" LATIN SMALL LETTER AE
@@ -2027,8 +2035,8 @@ public final class KeyboardTextsTable {
/* morekeys_t */ "\u00FE",
};
- /* Language it: Italian */
- private static final String[] LANGUAGE_it = {
+ /* Locale it: Italian */
+ private static final String[] TEXTS_it = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -2072,8 +2080,8 @@ public final class KeyboardTextsTable {
/* morekeys_i */ "\u00EC,\u00ED,\u00EE,\u00EF,\u012F,\u012B",
};
- /* Language iw: Hebrew */
- private static final String[] LANGUAGE_iw = {
+ /* Locale iw: Hebrew */
+ private static final String[] TEXTS_iw = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -2122,15 +2130,16 @@ public final class KeyboardTextsTable {
/* keyspec_tablet_comma ~ */
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null,
/* ~ morekeys_tablet_punctuation */
// U+00B1: "±" PLUS-MINUS SIGN
// U+FB29: "﬩" HEBREW LETTER ALTERNATIVE PLUS SIGN
/* morekeys_plus */ "\u00B1,\uFB29",
};
- /* Language ka_GE: Georgian (Georgia) */
- private static final String[] LANGUAGE_ka_GE = {
+ /* Locale ka_GE: Georgian (Georgia) */
+ private static final String[] TEXTS_ka_GE = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -2144,8 +2153,8 @@ public final class KeyboardTextsTable {
/* keylabel_to_alpha */ "\u10D0\u10D1\u10D2",
};
- /* Language kk: Kazakh */
- private static final String[] LANGUAGE_kk = {
+ /* Locale kk: Kazakh */
+ private static final String[] TEXTS_kk = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2190,8 +2199,9 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_o */ "\u04E9",
/* morekeys_cyrillic_i ~ */
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- /* ~ morekeys_j */
+ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null,
+ /* ~ keyspec_x */
// U+04BB: "һ" CYRILLIC SMALL LETTER SHHA
/* morekeys_east_slavic_row2_11 */ "\u04BB",
// U+049B: "қ" CYRILLIC SMALL LETTER KA WITH DESCENDER
@@ -2200,8 +2210,8 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_a */ "\u04D9",
};
- /* Language km_KH: Khmer (Cambodia) */
- private static final String[] LANGUAGE_km_KH = {
+ /* Locale km_KH: Khmer (Cambodia) */
+ private static final String[] TEXTS_km_KH = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2217,14 +2227,15 @@ public final class KeyboardTextsTable {
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
- null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null,
/* ~ morekeys_cyrillic_a */
// U+17DB: "៛" KHMER CURRENCY SYMBOL RIEL
/* morekeys_currency_dollar */ "\u17DB,\u00A2,\u00A3,\u20AC,\u00A5,\u20B1",
};
- /* Language ky: Kirghiz */
- private static final String[] LANGUAGE_ky = {
+ /* Locale ky: Kirghiz */
+ private static final String[] TEXTS_ky = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2265,8 +2276,8 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_o */ "\u04E9",
};
- /* Language lo_LA: Lao (Laos) */
- private static final String[] LANGUAGE_lo_LA = {
+ /* Locale lo_LA: Lao (Laos) */
+ private static final String[] TEXTS_lo_LA = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2282,8 +2293,8 @@ public final class KeyboardTextsTable {
/* keyspec_currency */ "\u20AD",
};
- /* Language lt: Lithuanian */
- private static final String[] LANGUAGE_lt = {
+ /* Locale lt: Lithuanian */
+ private static final String[] TEXTS_lt = {
// U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
@@ -2377,8 +2388,8 @@ public final class KeyboardTextsTable {
/* morekeys_k */ "\u0137",
};
- /* Language lv: Latvian */
- private static final String[] LANGUAGE_lv = {
+ /* Locale lv: Latvian */
+ private static final String[] TEXTS_lv = {
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
@@ -2471,8 +2482,8 @@ public final class KeyboardTextsTable {
/* morekeys_k */ "\u0137",
};
- /* Language mk: Macedonian */
- private static final String[] LANGUAGE_mk = {
+ /* Locale mk: Macedonian */
+ private static final String[] TEXTS_mk = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -2507,8 +2518,8 @@ public final class KeyboardTextsTable {
/* keyspec_south_slavic_row3_8 */ "\u0453",
};
- /* Language mn_MN: Mongolian (Mongolia) */
- private static final String[] LANGUAGE_mn_MN = {
+ /* Locale mn_MN: Mongolian (Mongolia) */
+ private static final String[] TEXTS_mn_MN = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2524,8 +2535,8 @@ public final class KeyboardTextsTable {
/* keyspec_currency */ "\u20AE",
};
- /* Language my_MM: Burmese (Myanmar) */
- private static final String[] LANGUAGE_my_MM = {
+ /* Locale my_MM: Burmese (Myanmar) */
+ private static final String[] TEXTS_my_MM = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2536,8 +2547,8 @@ public final class KeyboardTextsTable {
/* keylabel_to_alpha */ "\u1000\u1001\u1002",
};
- /* Language nb: Norwegian Bokmål */
- private static final String[] LANGUAGE_nb = {
+ /* Locale nb: Norwegian Bokmål */
+ private static final String[] TEXTS_nb = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
@@ -2590,8 +2601,8 @@ public final class KeyboardTextsTable {
/* morekeys_nordic_row2_11 */ "\u00E4",
};
- /* Language ne_NP: Nepali (Nepal) */
- private static final String[] LANGUAGE_ne_NP = {
+ /* Locale ne_NP: Nepali (Nepal) */
+ private static final String[] TEXTS_ne_NP = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -2642,8 +2653,8 @@ public final class KeyboardTextsTable {
/* additional_morekeys_symbols_0 */ "0",
};
- /* Language nl: Dutch */
- private static final String[] LANGUAGE_nl = {
+ /* Locale nl: Dutch */
+ private static final String[] TEXTS_nl = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -2696,8 +2707,8 @@ public final class KeyboardTextsTable {
/* morekeys_y */ "\u0133",
};
- /* Language pl: Polish */
- private static final String[] LANGUAGE_pl = {
+ /* Locale pl: Polish */
+ private static final String[] TEXTS_pl = {
// U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
@@ -2752,8 +2763,8 @@ public final class KeyboardTextsTable {
/* morekeys_l */ "\u0142",
};
- /* Language pt: Portuguese */
- private static final String[] LANGUAGE_pt = {
+ /* Locale pt: Portuguese */
+ private static final String[] TEXTS_pt = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
@@ -2800,8 +2811,8 @@ public final class KeyboardTextsTable {
/* morekeys_c */ "\u00E7,\u010D,\u0107",
};
- /* Language rm: Raeto-Romance */
- private static final String[] LANGUAGE_rm = {
+ /* Locale rm: Raeto-Romance */
+ private static final String[] TEXTS_rm = {
/* morekeys_a */ null,
// U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
// U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
@@ -2813,8 +2824,8 @@ public final class KeyboardTextsTable {
/* morekeys_o */ "\u00F2,\u00F3,\u00F6,\u00F4,\u00F5,\u0153,\u00F8",
};
- /* Language ro: Romanian */
- private static final String[] LANGUAGE_ro = {
+ /* Locale ro: Romanian */
+ private static final String[] TEXTS_ro = {
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
// U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
// U+0103: "ă" LATIN SMALL LETTER A WITH BREVE
@@ -2852,8 +2863,8 @@ public final class KeyboardTextsTable {
/* morekeys_t */ "\u021B",
};
- /* Language ru: Russian */
- private static final String[] LANGUAGE_ru = {
+ /* Locale ru: Russian */
+ private static final String[] TEXTS_ru = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -2885,8 +2896,8 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_soft_sign */ "\u044A",
};
- /* Language sk: Slovak */
- private static final String[] LANGUAGE_sk = {
+ /* Locale sk: Slovak */
+ private static final String[] TEXTS_sk = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
@@ -2980,8 +2991,8 @@ public final class KeyboardTextsTable {
/* morekeys_k */ "\u0137",
};
- /* Language sl: Slovenian */
- private static final String[] LANGUAGE_sl = {
+ /* Locale sl: Slovenian */
+ private static final String[] TEXTS_sl = {
/* morekeys_a ~ */
null, null, null, null, null,
/* ~ morekeys_i */
@@ -3006,8 +3017,8 @@ public final class KeyboardTextsTable {
/* double_angle_quotes */ "!text/double_raqm_laqm",
};
- /* Language sr: Serbian */
- private static final String[] LANGUAGE_sr = {
+ /* Locale sr: Serbian */
+ private static final String[] TEXTS_sr = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -3066,8 +3077,8 @@ public final class KeyboardTextsTable {
/* keyspec_south_slavic_row3_8 */ "\u0452",
};
- /* Language sv: Swedish */
- private static final String[] LANGUAGE_sv = {
+ /* Locale sv: Swedish */
+ private static final String[] TEXTS_sv = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -3152,8 +3163,8 @@ public final class KeyboardTextsTable {
/* morekeys_nordic_row2_11 */ "\u00E6",
};
- /* Language sw: Swahili */
- private static final String[] LANGUAGE_sw = {
+ /* Locale sw: Swahili */
+ private static final String[] TEXTS_sw = {
// This is the same as English except morekeys_g.
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
@@ -3206,8 +3217,8 @@ public final class KeyboardTextsTable {
/* morekeys_g */ "g\'",
};
- /* Language th: Thai */
- private static final String[] LANGUAGE_th = {
+ /* Locale th: Thai */
+ private static final String[] TEXTS_th = {
/* morekeys_a ~ */
null, null, null, null, null, null, null, null, null,
/* ~ single_quotes */
@@ -3223,8 +3234,8 @@ public final class KeyboardTextsTable {
/* keyspec_currency */ "\u0E3F",
};
- /* Language tl: Tagalog */
- private static final String[] LANGUAGE_tl = {
+ /* Locale tl: Tagalog */
+ private static final String[] TEXTS_tl = {
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
@@ -3277,8 +3288,8 @@ public final class KeyboardTextsTable {
/* morekeys_n */ "\u00F1,\u0144",
};
- /* Language tr: Turkish */
- private static final String[] LANGUAGE_tr = {
+ /* Locale tr: Turkish */
+ private static final String[] TEXTS_tr = {
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
/* morekeys_a */ "\u00E2",
// U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
@@ -3324,8 +3335,8 @@ public final class KeyboardTextsTable {
/* morekeys_g */ "\u011F",
};
- /* Language uk: Ukrainian */
- private static final String[] LANGUAGE_uk = {
+ /* Locale uk: Ukrainian */
+ private static final String[] TEXTS_uk = {
/* morekeys_a ~ */
null, null, null, null, null, null,
/* ~ morekeys_c */
@@ -3368,8 +3379,8 @@ public final class KeyboardTextsTable {
/* morekeys_cyrillic_ghe */ "\u0491",
};
- /* Language vi: Vietnamese */
- private static final String[] LANGUAGE_vi = {
+ /* Locale vi: Vietnamese */
+ private static final String[] TEXTS_vi = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+1EA3: "ả" LATIN SMALL LETTER A WITH HOOK ABOVE
@@ -3454,8 +3465,8 @@ public final class KeyboardTextsTable {
/* keyspec_currency */ "\u20AB",
};
- /* Language zu: Zulu */
- private static final String[] LANGUAGE_zu = {
+ /* Locale zu: Zulu */
+ private static final String[] TEXTS_zu = {
// This is the same as English
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
@@ -3504,8 +3515,8 @@ public final class KeyboardTextsTable {
/* morekeys_s */ "\u00DF",
};
- /* Language zz: Alphabet */
- private static final String[] LANGUAGE_zz = {
+ /* Locale zz: Alphabet */
+ private static final String[] TEXTS_zz = {
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
@@ -3643,67 +3654,65 @@ public final class KeyboardTextsTable {
/* morekeys_j */ "\u0135",
};
- // TODO: Use the language + "_" + region representation for the locale string key.
- // Currently we are dropping the region from the key.
- private static final Object[] LANGUAGES_AND_TEXTS = {
+ private static final Object[] LOCALES_AND_TEXTS = {
// "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */
- "DEFAULT", LANGUAGE_DEFAULT, /* 168/168 default */
- "af", LANGUAGE_af, /* 7/ 12 Afrikaans */
- "ar", LANGUAGE_ar, /* 55/107 Arabic */
- "az", LANGUAGE_az_AZ, /* 8/ 17 Azerbaijani (Azerbaijan) */
- "be", LANGUAGE_be_BY, /* 9/ 32 Belarusian (Belarus) */
- "bg", LANGUAGE_bg, /* 2/ 10 Bulgarian */
- "ca", LANGUAGE_ca, /* 11/114 Catalan */
- "cs", LANGUAGE_cs, /* 17/ 21 Czech */
- "da", LANGUAGE_da, /* 19/ 33 Danish */
- "de", LANGUAGE_de, /* 16/ 91 German */
- "el", LANGUAGE_el, /* 1/ 10 Greek */
- "en", LANGUAGE_en, /* 8/ 11 English */
- "eo", LANGUAGE_eo, /* 26/126 Esperanto */
- "es", LANGUAGE_es, /* 8/ 55 Spanish */
- "et", LANGUAGE_et_EE, /* 22/ 27 Estonian (Estonia) */
- "eu", LANGUAGE_eu_ES, /* 7/ 8 Basque (Spain) */
- "fa", LANGUAGE_fa, /* 58/117 Persian */
- "fi", LANGUAGE_fi, /* 10/ 33 Finnish */
- "fr", LANGUAGE_fr, /* 13/ 91 French */
- "gl", LANGUAGE_gl_ES, /* 7/ 8 Gallegan (Spain) */
- "hi", LANGUAGE_hi, /* 23/ 54 Hindi */
- "hr", LANGUAGE_hr, /* 9/ 19 Croatian */
- "hu", LANGUAGE_hu, /* 9/ 19 Hungarian */
- "hy", LANGUAGE_hy_AM, /* 8/120 Armenian (Armenia) */
- "is", LANGUAGE_is, /* 10/ 15 Icelandic */
- "it", LANGUAGE_it, /* 5/ 5 Italian */
- "iw", LANGUAGE_iw, /* 20/115 Hebrew */
- "ka", LANGUAGE_ka_GE, /* 3/ 10 Georgian (Georgia) */
- "kk", LANGUAGE_kk, /* 15/112 Kazakh */
- "km", LANGUAGE_km_KH, /* 2/113 Khmer (Cambodia) */
- "ky", LANGUAGE_ky, /* 10/ 80 Kirghiz */
- "lo", LANGUAGE_lo_LA, /* 2/ 20 Lao (Laos) */
- "lt", LANGUAGE_lt, /* 18/ 22 Lithuanian */
- "lv", LANGUAGE_lv, /* 18/ 22 Latvian */
- "mk", LANGUAGE_mk, /* 9/ 85 Macedonian */
- "mn", LANGUAGE_mn_MN, /* 2/ 20 Mongolian (Mongolia) */
- "my", LANGUAGE_my_MM, /* 1/ 10 Burmese (Myanmar) */
- "nb", LANGUAGE_nb, /* 11/ 33 Norwegian Bokmål */
- "ne", LANGUAGE_ne_NP, /* 23/ 54 Nepali (Nepal) */
- "nl", LANGUAGE_nl, /* 9/ 12 Dutch */
- "pl", LANGUAGE_pl, /* 10/ 16 Polish */
- "pt", LANGUAGE_pt, /* 6/ 6 Portuguese */
- "rm", LANGUAGE_rm, /* 1/ 2 Raeto-Romance */
- "ro", LANGUAGE_ro, /* 6/ 15 Romanian */
- "ru", LANGUAGE_ru, /* 9/ 32 Russian */
- "sk", LANGUAGE_sk, /* 20/ 22 Slovak */
- "sl", LANGUAGE_sl, /* 8/ 19 Slovenian */
- "sr", LANGUAGE_sr, /* 11/ 85 Serbian */
- "sv", LANGUAGE_sv, /* 21/ 33 Swedish */
- "sw", LANGUAGE_sw, /* 9/ 17 Swahili */
- "th", LANGUAGE_th, /* 2/ 20 Thai */
- "tl", LANGUAGE_tl, /* 7/ 8 Tagalog */
- "tr", LANGUAGE_tr, /* 7/ 17 Turkish */
- "uk", LANGUAGE_uk, /* 11/ 79 Ukrainian */
- "vi", LANGUAGE_vi, /* 8/ 20 Vietnamese */
- "zu", LANGUAGE_zu, /* 8/ 11 Zulu */
- "zz", LANGUAGE_zz, /* 19/109 Alphabet */
+ "DEFAULT", TEXTS_DEFAULT, /* 168/168 default */
+ "af" , TEXTS_af, /* 7/ 12 Afrikaans */
+ "ar" , TEXTS_ar, /* 55/107 Arabic */
+ "az_AZ" , TEXTS_az_AZ, /* 8/ 17 Azerbaijani (Azerbaijan) */
+ "be_BY" , TEXTS_be_BY, /* 9/ 32 Belarusian (Belarus) */
+ "bg" , TEXTS_bg, /* 2/ 10 Bulgarian */
+ "ca" , TEXTS_ca, /* 11/120 Catalan */
+ "cs" , TEXTS_cs, /* 17/ 21 Czech */
+ "da" , TEXTS_da, /* 19/ 33 Danish */
+ "de" , TEXTS_de, /* 16/ 91 German */
+ "el" , TEXTS_el, /* 1/ 10 Greek */
+ "en" , TEXTS_en, /* 8/ 11 English */
+ "eo" , TEXTS_eo, /* 26/115 Esperanto */
+ "es" , TEXTS_es, /* 8/ 55 Spanish */
+ "et_EE" , TEXTS_et_EE, /* 22/ 27 Estonian (Estonia) */
+ "eu_ES" , TEXTS_eu_ES, /* 7/ 8 Basque (Spain) */
+ "fa" , TEXTS_fa, /* 58/123 Persian */
+ "fi" , TEXTS_fi, /* 10/ 33 Finnish */
+ "fr" , TEXTS_fr, /* 13/ 91 French */
+ "gl_ES" , TEXTS_gl_ES, /* 7/ 8 Gallegan (Spain) */
+ "hi" , TEXTS_hi, /* 23/ 54 Hindi */
+ "hr" , TEXTS_hr, /* 9/ 19 Croatian */
+ "hu" , TEXTS_hu, /* 9/ 19 Hungarian */
+ "hy_AM" , TEXTS_hy_AM, /* 8/126 Armenian (Armenia) */
+ "is" , TEXTS_is, /* 10/ 15 Icelandic */
+ "it" , TEXTS_it, /* 5/ 5 Italian */
+ "iw" , TEXTS_iw, /* 20/121 Hebrew */
+ "ka_GE" , TEXTS_ka_GE, /* 3/ 10 Georgian (Georgia) */
+ "kk" , TEXTS_kk, /* 15/118 Kazakh */
+ "km_KH" , TEXTS_km_KH, /* 2/119 Khmer (Cambodia) */
+ "ky" , TEXTS_ky, /* 10/ 80 Kirghiz */
+ "lo_LA" , TEXTS_lo_LA, /* 2/ 20 Lao (Laos) */
+ "lt" , TEXTS_lt, /* 18/ 22 Lithuanian */
+ "lv" , TEXTS_lv, /* 18/ 22 Latvian */
+ "mk" , TEXTS_mk, /* 9/ 85 Macedonian */
+ "mn_MN" , TEXTS_mn_MN, /* 2/ 20 Mongolian (Mongolia) */
+ "my_MM" , TEXTS_my_MM, /* 1/ 10 Burmese (Myanmar) */
+ "nb" , TEXTS_nb, /* 11/ 33 Norwegian Bokmål */
+ "ne_NP" , TEXTS_ne_NP, /* 23/ 54 Nepali (Nepal) */
+ "nl" , TEXTS_nl, /* 9/ 12 Dutch */
+ "pl" , TEXTS_pl, /* 10/ 16 Polish */
+ "pt" , TEXTS_pt, /* 6/ 6 Portuguese */
+ "rm" , TEXTS_rm, /* 1/ 2 Raeto-Romance */
+ "ro" , TEXTS_ro, /* 6/ 15 Romanian */
+ "ru" , TEXTS_ru, /* 9/ 32 Russian */
+ "sk" , TEXTS_sk, /* 20/ 22 Slovak */
+ "sl" , TEXTS_sl, /* 8/ 19 Slovenian */
+ "sr" , TEXTS_sr, /* 11/ 85 Serbian */
+ "sv" , TEXTS_sv, /* 21/ 33 Swedish */
+ "sw" , TEXTS_sw, /* 9/ 17 Swahili */
+ "th" , TEXTS_th, /* 2/ 20 Thai */
+ "tl" , TEXTS_tl, /* 7/ 8 Tagalog */
+ "tr" , TEXTS_tr, /* 7/ 17 Turkish */
+ "uk" , TEXTS_uk, /* 11/ 79 Ukrainian */
+ "vi" , TEXTS_vi, /* 8/ 20 Vietnamese */
+ "zu" , TEXTS_zu, /* 8/ 11 Zulu */
+ "zz" , TEXTS_zz, /* 19/109 Alphabet */
};
static {
@@ -3711,11 +3720,11 @@ public final class KeyboardTextsTable {
sNameToIndexesMap.put(NAMES[index], index);
}
- for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) {
- final String language = (String)LANGUAGES_AND_TEXTS[i];
- final String[] textsTable = (String[])LANGUAGES_AND_TEXTS[i + 1];
- sLanguageToTextsTableMap.put(language, textsTable);
- sTextsTableToLanguageMap.put(textsTable, language);
+ for (int i = 0; i < LOCALES_AND_TEXTS.length; i += 2) {
+ final String locale = (String)LOCALES_AND_TEXTS[i];
+ final String[] textsTable = (String[])LOCALES_AND_TEXTS[i + 1];
+ sLocaleToTextsTableMap.put(locale, textsTable);
+ sTextsTableToLocaleMap.put(textsTable, locale);
}
}
}
diff --git a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java b/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java
index 9870faa98..be54b669b 100644
--- a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java
+++ b/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java
@@ -23,6 +23,7 @@ import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface.OnShowListener;
+import com.android.inputmethod.latin.utils.DialogUtils;
import com.android.inputmethod.latin.utils.ImportantNoticeUtils;
/**
@@ -40,7 +41,7 @@ public final class ImportantNoticeDialog extends AlertDialog implements OnShowLi
public ImportantNoticeDialog(
final Context context, final ImportantNoticeDialogListener listener) {
- super(context, THEME_HOLO_DARK);
+ super(DialogUtils.getPlatformDialogThemeContext(context));
mListener = listener;
mNextImportantNoticeVersion = ImportantNoticeUtils.getNextImportantNoticeVersion(context);
setMessage(ImportantNoticeUtils.getNextImportantNoticeContents(context));
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 325ef6494..6d36af77a 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -83,6 +83,7 @@ import com.android.inputmethod.latin.suggestions.SuggestionStripViewAccessor;
import com.android.inputmethod.latin.utils.ApplicationUtils;
import com.android.inputmethod.latin.utils.CapsModeUtils;
import com.android.inputmethod.latin.utils.CoordinateUtils;
+import com.android.inputmethod.latin.utils.DialogUtils;
import com.android.inputmethod.latin.utils.ImportantNoticeUtils;
import com.android.inputmethod.latin.utils.IntentUtils;
import com.android.inputmethod.latin.utils.JniUtils;
@@ -198,7 +199,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
latinIme.mSettings.getCurrent());
break;
case MSG_UPDATE_SHIFT_STATE:
- switcher.updateShiftState();
+ switcher.requestUpdatingShiftState();
break;
case MSG_SHOW_GESTURE_PREVIEW_AND_SUGGESTION_STRIP:
if (msg.arg1 == ARG1_NOT_GESTURE_INPUT) {
@@ -837,7 +838,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// we need to re-evaluate the shift state, but not the whole layout which would be
// disruptive.
// Space state must be updated before calling updateShiftState
- switcher.updateShiftState();
+ switcher.requestUpdatingShiftState();
}
// This will set the punctuation suggestions if next word suggestion is off;
// otherwise it will clear the suggestion strip.
@@ -916,7 +917,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: find a better way to simulate actual execution.
if (isInputViewShown() &&
mInputLogic.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd)) {
- mKeyboardSwitcher.updateShiftState();
+ mKeyboardSwitcher.requestUpdatingShiftState();
}
mSubtypeState.currentSubtypeUsed();
@@ -1235,7 +1236,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mInputLogic.onCodeInput(mSettings.getCurrent(), event,
mKeyboardSwitcher.getKeyboardShiftMode(), mHandler);
updateStateAfterInputTransaction(completeInputTransaction);
- mKeyboardSwitcher.onCodeInput(codePoint);
+ mKeyboardSwitcher.onCodeInput(codePoint, getCurrentAutoCapsState());
}
// A helper method to split the code point and the key code. Ultimately, they should not be
@@ -1260,8 +1261,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: have the keyboard pass the correct key code when we need it.
final Event event = Event.createSoftwareTextEvent(rawText, Event.NOT_A_KEY_CODE);
mInputLogic.onTextInput(mSettings.getCurrent(), event, mHandler);
- mKeyboardSwitcher.updateShiftState();
- mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT);
+ mKeyboardSwitcher.requestUpdatingShiftState();
+ mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT, getCurrentAutoCapsState());
}
@Override
@@ -1504,7 +1505,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHandler.postUpdateShiftState();
break;
case InputTransaction.SHIFT_UPDATE_NOW:
- mKeyboardSwitcher.updateShiftState();
+ mKeyboardSwitcher.requestUpdatingShiftState();
break;
default: // SHIFT_NO_UPDATE
}
@@ -1544,7 +1545,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onPressKey(final int primaryCode, final int repeatCount,
final boolean isSinglePointer) {
- mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer);
+ mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer, getCurrentAutoCapsState());
hapticAndAudioFeedback(primaryCode, repeatCount);
}
@@ -1666,8 +1667,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
};
- final AlertDialog.Builder builder =
- new AlertDialog.Builder(this).setItems(items, listener).setTitle(title);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(
+ DialogUtils.getPlatformDialogThemeContext(this));
+ builder.setItems(items, listener).setTitle(title);
showOptionDialog(builder.create());
}
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index f31fb134c..81d642ff2 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -165,67 +165,61 @@ public final class WordComposer {
}
/**
- * Add a new event for a key stroke, with the pressed key's code point with the touch point
- * coordinates.
+ * Process an input event.
+ *
+ * All input events should be supported, including software/hardware events, characters as well
+ * as deletions, multiple inputs and gestures.
+ *
+ * @param event the event to process.
*/
- public void add(final Event event) {
+ public void processEvent(final Event event) {
final int primaryCode = event.mCodePoint;
final int keyX = event.mX;
final int keyY = event.mY;
final int newIndex = size();
- processEvent(event);
- mCursorPositionWithinWord = mCodePointSize;
- if (newIndex < MAX_WORD_LENGTH) {
- mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE
- ? Character.toLowerCase(primaryCode) : primaryCode;
- // In the batch input mode, the {@code mInputPointers} holds batch input points and
- // shouldn't be overridden by the "typed key" coordinates
- // (See {@link #setBatchInputWord}).
- if (!mIsBatchMode) {
- // TODO: Set correct pointer id and time
- mInputPointers.addPointerAt(newIndex, keyX, keyY, 0, 0);
- }
- }
- mIsFirstCharCapitalized = isFirstCharCapitalized(
- newIndex, primaryCode, mIsFirstCharCapitalized);
- if (Character.isUpperCase(primaryCode)) mCapsCount++;
- if (Character.isDigit(primaryCode)) mDigitsCount++;
- if (Constants.CODE_SINGLE_QUOTE == primaryCode) {
- ++mTrailingSingleQuotesCount;
- } else {
- mTrailingSingleQuotesCount = 0;
- }
- mAutoCorrection = null;
- }
-
- private void processEvent(final Event event) {
mCombinerChain.processEvent(mEvents, event);
mEvents.add(event);
refreshTypedWordCache();
- }
-
- /**
- * Delete the last composing unit as a result of hitting backspace.
- */
- public void deleteLast(final Event event) {
- processEvent(event);
+ mCursorPositionWithinWord = mCodePointSize;
// We may have deleted the last one.
- if (0 == size()) {
+ if (0 == mCodePointSize) {
mIsFirstCharCapitalized = false;
}
- if (mTrailingSingleQuotesCount > 0) {
- --mTrailingSingleQuotesCount;
- } else {
- int i = mTypedWordCache.length();
- while (i > 0) {
- i = Character.offsetByCodePoints(mTypedWordCache, i, -1);
- if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) {
- break;
+ if (Constants.CODE_DELETE == event.mKeyCode) {
+ if (mTrailingSingleQuotesCount > 0) {
+ --mTrailingSingleQuotesCount;
+ } else {
+ // Delete, but we didn't end in a quote: must recompute mTrailingSingleQuotesCount
+ // We're only searching for single quotes, so no need to account for code points
+ for (int i = mTypedWordCache.length() - 1; i > 0; --i) {
+ if (Constants.CODE_SINGLE_QUOTE != mTypedWordCache.charAt(i)) {
+ break;
+ }
+ ++mTrailingSingleQuotesCount;
}
+ }
+ } else {
+ if (Constants.CODE_SINGLE_QUOTE == primaryCode) {
++mTrailingSingleQuotesCount;
+ } else {
+ mTrailingSingleQuotesCount = 0;
}
+ if (newIndex < MAX_WORD_LENGTH) {
+ mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE
+ ? Character.toLowerCase(primaryCode) : primaryCode;
+ // In the batch input mode, the {@code mInputPointers} holds batch input points and
+ // shouldn't be overridden by the "typed key" coordinates
+ // (See {@link #setBatchInputWord}).
+ if (!mIsBatchMode) {
+ // TODO: Set correct pointer id and time
+ mInputPointers.addPointerAt(newIndex, keyX, keyY, 0, 0);
+ }
+ }
+ mIsFirstCharCapitalized = isFirstCharCapitalized(
+ newIndex, primaryCode, mIsFirstCharCapitalized);
+ if (Character.isUpperCase(primaryCode)) mCapsCount++;
+ if (Character.isDigit(primaryCode)) mDigitsCount++;
}
- mCursorPositionWithinWord = mCodePointSize;
mAutoCorrection = null;
}
@@ -300,7 +294,7 @@ public final class WordComposer {
final int codePoint = Character.codePointAt(word, i);
// We don't want to override the batch input points that are held in mInputPointers
// (See {@link #add(int,int,int)}).
- add(Event.createEventForCodePointFromUnknownSource(codePoint));
+ processEvent(Event.createEventForCodePointFromUnknownSource(codePoint));
}
}
@@ -317,7 +311,7 @@ public final class WordComposer {
reset();
final int length = codePoints.length;
for (int i = 0; i < length; ++i) {
- add(Event.createEventForCodePointFromAlreadyTypedText(codePoints[i],
+ processEvent(Event.createEventForCodePointFromAlreadyTypedText(codePoints[i],
CoordinateUtils.xFromArray(coordinates, i),
CoordinateUtils.yFromArray(coordinates, i)));
}
diff --git a/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java b/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java
index 800f56597..139e73aa4 100644
--- a/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java
+++ b/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java
@@ -28,6 +28,7 @@ import com.android.inputmethod.latin.BinaryDictionaryGetter;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.makedict.DictionaryHeader;
import com.android.inputmethod.latin.utils.CollectionUtils;
+import com.android.inputmethod.latin.utils.DialogUtils;
import com.android.inputmethod.latin.utils.DictionaryInfoUtils;
import com.android.inputmethod.latin.utils.LocaleUtils;
@@ -70,7 +71,7 @@ public class ExternalDictionaryGetterForDebug {
}
private static void showNoFileDialog(final Context context) {
- new AlertDialog.Builder(context)
+ new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context))
.setMessage(R.string.read_external_dictionary_no_files_message)
.setPositiveButton(android.R.string.ok, new OnClickListener() {
@Override
@@ -81,8 +82,8 @@ public class ExternalDictionaryGetterForDebug {
}
private static void showChooseFileDialog(final Context context, final String[] fileNames) {
- final AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setTitle(R.string.read_external_dictionary_multiple_files_title)
+ new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context))
+ .setTitle(R.string.read_external_dictionary_multiple_files_title)
.setItems(fileNames, new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
@@ -111,7 +112,7 @@ public class ExternalDictionaryGetterForDebug {
final String title = String.format(
context.getString(R.string.read_external_dictionary_confirm_install_message),
languageName);
- new AlertDialog.Builder(context)
+ new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context))
.setTitle(title)
.setMessage(message)
.setNegativeButton(android.R.string.cancel, new OnClickListener() {
@@ -167,7 +168,7 @@ public class ExternalDictionaryGetterForDebug {
}
} catch (IOException e) {
// There was an error: show a dialog
- new AlertDialog.Builder(context)
+ new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context))
.setTitle(R.string.error)
.setMessage(e.toString())
.setPositiveButton(android.R.string.ok, new OnClickListener() {
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index c89be35ad..7cf8c5e49 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -537,7 +537,7 @@ public final class InputLogic {
// after typing some letters and a period, then gesturing; the keyboard is not in
// caps mode yet, but since a gesture is starting, it should go in caps mode,
// unless the user explictly said it should not.
- keyboardSwitcher.updateShiftState();
+ keyboardSwitcher.requestUpdatingShiftState();
}
}
mConnection.endBatchEdit();
@@ -579,7 +579,7 @@ public final class InputLogic {
promotePhantomSpace(settingsValues);
mConnection.commitText(commitParts[0], 0);
mSpaceState = SpaceState.PHANTOM;
- keyboardSwitcher.updateShiftState();
+ keyboardSwitcher.requestUpdatingShiftState();
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
getActualCapsMode(settingsValues,
keyboardSwitcher.getKeyboardShiftMode()), commitParts[0]);
@@ -727,7 +727,7 @@ public final class InputLogic {
resetComposingState(false /* alsoResetLastComposedWord */);
}
if (isComposingWord) {
- mWordComposer.add(inputTransaction.mEvent);
+ mWordComposer.processEvent(inputTransaction.mEvent);
// If it's the first letter, make note of auto-caps state
if (mWordComposer.isSingleLetter()) {
// We pass 1 to getPreviousWordForSuggestion because we were not composing a word
@@ -823,13 +823,11 @@ public final class InputLogic {
}
if (Constants.CODE_SPACE == codePoint) {
- if (inputTransaction.mSettingsValues.isSuggestionsRequested()) {
- if (maybeDoubleSpacePeriod(inputTransaction)) {
- inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW);
- mSpaceState = SpaceState.DOUBLE;
- } else if (!mSuggestedWords.isPunctuationSuggestions()) {
- mSpaceState = SpaceState.WEAK;
- }
+ if (maybeDoubleSpacePeriod(inputTransaction)) {
+ inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW);
+ mSpaceState = SpaceState.DOUBLE;
+ } else if (!mSuggestedWords.isPunctuationSuggestions()) {
+ mSpaceState = SpaceState.WEAK;
}
startDoubleSpacePeriodCountdown(inputTransaction);
@@ -895,7 +893,7 @@ public final class InputLogic {
mWordComposer.reset();
mWordComposer.setRejectedBatchModeSuggestion(rejectedSuggestion);
} else {
- mWordComposer.deleteLast(inputTransaction.mEvent);
+ mWordComposer.processEvent(inputTransaction.mEvent);
}
mConnection.setComposingText(getTextWithUnderline(mWordComposer.getTypedWord()), 1);
inputTransaction.setRequiresUpdateSuggestions();
@@ -1821,7 +1819,7 @@ public final class InputLogic {
}
// Space state must be updated before calling updateShiftState
mSpaceState = SpaceState.PHANTOM;
- keyboardSwitcher.updateShiftState();
+ keyboardSwitcher.requestUpdatingShiftState();
}
/**
diff --git a/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java b/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java
index 6dae6206c..39977e76f 100644
--- a/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java
+++ b/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java
@@ -48,6 +48,7 @@ import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.RichInputMethodManager;
import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils;
import com.android.inputmethod.latin.utils.CollectionUtils;
+import com.android.inputmethod.latin.utils.DialogUtils;
import com.android.inputmethod.latin.utils.IntentUtils;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
@@ -517,7 +518,8 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment {
private AlertDialog createDialog(
@SuppressWarnings("unused") final SubtypePreference subtypePref) {
- final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ final AlertDialog.Builder builder = new AlertDialog.Builder(
+ DialogUtils.getPlatformDialogThemeContext(getActivity()));
builder.setTitle(R.string.custom_input_styles_title)
.setMessage(R.string.custom_input_style_note_message)
.setNegativeButton(R.string.not_now, null)
diff --git a/java/src/com/android/inputmethod/latin/utils/DialogUtils.java b/java/src/com/android/inputmethod/latin/utils/DialogUtils.java
new file mode 100644
index 000000000..a05c932d0
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/utils/DialogUtils.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.utils;
+
+import android.content.Context;
+import android.view.ContextThemeWrapper;
+
+import com.android.inputmethod.latin.R;
+
+public final class DialogUtils {
+ private DialogUtils() {
+ // This utility class is not publicly instantiable.
+ }
+
+ public static Context getPlatformDialogThemeContext(final Context context) {
+ // Because {@link AlertDialog.Builder.create()} doesn't honor the specified theme with
+ // createThemeContextWrapper=false, the result dialog box has unneeded paddings around it.
+ return new ContextThemeWrapper(context, R.style.platformDialogTheme);
+ }
+}