diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java index a4a947e7f..d668840d8 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java @@ -73,27 +73,6 @@ public final class KeyboardId { private final int mHashCode; - public KeyboardId(final int elementId, final KeyboardLayoutSet.Params params) { - mKeyboardLayoutSetName = params.mSubtype.getKeyboardLayoutSetName(); - mLocale = params.mSubtype.getLocale(); - mWidth = params.mKeyboardWidth; - mHeight = params.mKeyboardHeight; - mMode = params.mMode; - mElementId = elementId; - mEditorInfo = params.mEditorInfo; - mClobberSettingsKey = params.mNoSettingsKey; - mBottomEmojiKeyEnabled = params.mBottomEmojiKeyEnabled; - mBottomActionKeyId = params.mBottomActionKeyId; - mCustomActionLabel = (mEditorInfo.actionLabel != null) - ? mEditorInfo.actionLabel.toString() : null; - mHasShortcutKey = params.mVoiceInputKeyEnabled; - mIsSplitLayout = params.mIsSplitLayoutEnabled; - mNumberRow = params.mNumberRow || params.mIsPasswordField; - mLongPressKeySettings = params.mLongPressKeySettings; - - mHashCode = computeHashCode(this); - } - public KeyboardId(String mKeyboardLayoutSetName, Locale mLocale, int mWidth, int mHeight, int mMode, int mElementId, EditorInfo mEditorInfo, boolean mClobberSettingsKey, boolean mBottomEmojiKeyEnabled, int mBottomActionKeyId, String mCustomActionLabel, boolean mHasShortcutKey, boolean mIsSplitLayout, boolean mNumberRow, LongPressKeySettings mLongPressKeySettings) { this.mKeyboardLayoutSetName = mKeyboardLayoutSetName; this.mLocale = mLocale; diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java deleted file mode 100644 index 39d8f2eb4..000000000 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Copyright (C) 2011 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 org.futo.inputmethod.keyboard; - -import static org.futo.inputmethod.latin.common.Constants.ImeOption.FORCE_ASCII; -import static org.futo.inputmethod.latin.common.Constants.ImeOption.NO_SETTINGS_KEY; - -import android.content.Context; -import android.content.res.Resources; -import android.content.res.TypedArray; -import android.content.res.XmlResourceParser; -import android.text.InputType; -import android.util.Log; -import android.util.SparseArray; -import android.util.Xml; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodSubtype; - -import org.futo.inputmethod.compat.EditorInfoCompatUtils; -import org.futo.inputmethod.compat.InputMethodSubtypeCompatUtils; -import org.futo.inputmethod.compat.UserManagerCompatUtils; -import org.futo.inputmethod.keyboard.internal.KeyboardBuilder; -import org.futo.inputmethod.keyboard.internal.KeyboardParams; -import org.futo.inputmethod.keyboard.internal.UniqueKeysCache; -import org.futo.inputmethod.latin.InputAttributes; -import org.futo.inputmethod.latin.R; -import org.futo.inputmethod.latin.RichInputMethodSubtype; -import org.futo.inputmethod.latin.settings.LongPressKeySettings; -import org.futo.inputmethod.latin.utils.InputTypeUtils; -import org.futo.inputmethod.latin.utils.ScriptUtils; -import org.futo.inputmethod.latin.utils.SubtypeLocaleUtils; -import org.futo.inputmethod.latin.utils.XmlParseUtils; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.IOException; -import java.lang.ref.SoftReference; -import java.util.HashMap; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * This class represents a set of keyboard layouts. Each of them represents a different keyboard - * specific to a keyboard state, such as alphabet, symbols, and so on. Layouts in the same - * {@link KeyboardLayoutSet} are related to each other. - * A {@link KeyboardLayoutSet} needs to be created for each - * {@link android.view.inputmethod.EditorInfo}. - */ -public final class KeyboardLayoutSet { - private static final String TAG = KeyboardLayoutSet.class.getSimpleName(); - private static final boolean DEBUG_CACHE = false; - - private static final String TAG_KEYBOARD_SET = "KeyboardLayoutSet"; - private static final String TAG_ELEMENT = "Element"; - private static final String TAG_FEATURE = "Feature"; - - private static final String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "keyboard_layout_set_"; - - private final Context mContext; - @Nonnull - private final Params mParams; - - // How many layouts we forcibly keep in cache. This only includes ALPHABET (default) and - // ALPHABET_AUTOMATIC_SHIFTED layouts - other layouts may stay in memory in the map of - // soft-references, but we forcibly cache this many alphabetic/auto-shifted layouts. - private static final int FORCIBLE_CACHE_SIZE = 4; - // By construction of soft references, anything that is also referenced somewhere else - // will stay in the cache. So we forcibly keep some references in an array to prevent - // them from disappearing from sKeyboardCache. - private static final Keyboard[] sForcibleKeyboardCache = new Keyboard[FORCIBLE_CACHE_SIZE]; - private static final HashMap> sKeyboardCache = - new HashMap<>(); - @Nonnull - private static final UniqueKeysCache sUniqueKeysCache = UniqueKeysCache.newInstance(); - private final static HashMap sScriptIdsForSubtypes = - new HashMap<>(); - - @SuppressWarnings("serial") - public static final class KeyboardLayoutSetException extends RuntimeException { - public final KeyboardId mKeyboardId; - - public KeyboardLayoutSetException(final Throwable cause, final KeyboardId keyboardId) { - super(cause); - mKeyboardId = keyboardId; - } - } - - private static final class ElementParams { - int mKeyboardXmlId; - boolean mProximityCharsCorrectionEnabled; - boolean mSupportsSplitLayout; - boolean mAllowRedundantMoreKeys; - public ElementParams() {} - } - - public static final class Params { - String mKeyboardLayoutSetName; - int mMode; - boolean mDisableTouchPositionCorrectionDataForTest; - // TODO: Use {@link InputAttributes} instead of these variables. - EditorInfo mEditorInfo; - boolean mIsPasswordField; - boolean mVoiceInputKeyEnabled; - boolean mNoSettingsKey; - boolean mBottomEmojiKeyEnabled; - int mBottomActionKeyId; - RichInputMethodSubtype mSubtype; - boolean mIsSpellChecker; - int mKeyboardWidth; - int mKeyboardHeight; - int mScriptId = ScriptUtils.SCRIPT_LATIN; - // Indicates if the user has enabled the split-layout preference - // and the required ProductionFlags are enabled. - boolean mIsSplitLayoutEnabledByUser; - // Indicates if split layout is actually enabled, taking into account - // whether the user has enabled it, and the keyboard layout supports it. - boolean mIsSplitLayoutEnabled; - // Sparse array of KeyboardLayoutSet element parameters indexed by element's id. - final SparseArray mKeyboardLayoutSetElementIdToParamsMap = - new SparseArray<>(); - - boolean mNumberRow; - - LongPressKeySettings mLongPressKeySettings; - } - - public static void onSystemLocaleChanged() { - clearKeyboardCache(); - } - - public static void onKeyboardThemeChanged() { - clearKeyboardCache(); - } - - private static void clearKeyboardCache() { - sKeyboardCache.clear(); - sUniqueKeysCache.clear(); - } - - public static int getScriptId(final Resources resources, - @Nonnull final InputMethodSubtype subtype) { - final Integer value = sScriptIdsForSubtypes.get(subtype); - if (null == value) { - final int scriptId = Builder.readScriptId(resources, subtype); - sScriptIdsForSubtypes.put(subtype, scriptId); - return scriptId; - } - return value; - } - - KeyboardLayoutSet(final Context context, @Nonnull final Params params) { - mContext = context; - mParams = params; - } - - @Nonnull - public Keyboard getKeyboard(final int baseKeyboardLayoutSetElementId) { - final int keyboardLayoutSetElementId; - switch (mParams.mMode) { - case KeyboardId.MODE_PHONE: - if (baseKeyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS) { - keyboardLayoutSetElementId = KeyboardId.ELEMENT_PHONE_SYMBOLS; - } else { - keyboardLayoutSetElementId = KeyboardId.ELEMENT_PHONE; - } - break; - case KeyboardId.MODE_NUMBER: - case KeyboardId.MODE_DATE: - case KeyboardId.MODE_TIME: - case KeyboardId.MODE_DATETIME: - keyboardLayoutSetElementId = KeyboardId.ELEMENT_NUMBER; - break; - default: - keyboardLayoutSetElementId = baseKeyboardLayoutSetElementId; - break; - } - - ElementParams elementParams = mParams.mKeyboardLayoutSetElementIdToParamsMap.get( - keyboardLayoutSetElementId); - if (elementParams == null) { - elementParams = mParams.mKeyboardLayoutSetElementIdToParamsMap.get( - KeyboardId.ELEMENT_ALPHABET); - } - // 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. - - mParams.mIsSplitLayoutEnabled = mParams.mIsSplitLayoutEnabledByUser - && elementParams.mSupportsSplitLayout; - final KeyboardId id = new KeyboardId(keyboardLayoutSetElementId, mParams); - try { - return getKeyboard(elementParams, id); - } catch (final RuntimeException e) { - Log.e(TAG, "Can't create keyboard: " + id, e); - throw new KeyboardLayoutSetException(e, id); - } - } - - @Nonnull - private Keyboard getKeyboard(final ElementParams elementParams, final KeyboardId id) { - final SoftReference ref = sKeyboardCache.get(id); - final Keyboard cachedKeyboard = (ref == null) ? null : ref.get(); - if (cachedKeyboard != null) { - if (DEBUG_CACHE) { - Log.d(TAG, "keyboard cache size=" + sKeyboardCache.size() + ": HIT id=" + id); - } - return cachedKeyboard; - } - - final KeyboardBuilder builder = - new KeyboardBuilder<>(mContext, new KeyboardParams(sUniqueKeysCache)); - sUniqueKeysCache.setEnabled(id.isAlphabetKeyboard()); - builder.setAllowRedundantMoreKes(elementParams.mAllowRedundantMoreKeys); - final int keyboardXmlId = elementParams.mKeyboardXmlId; - builder.load(keyboardXmlId, id); - if (mParams.mDisableTouchPositionCorrectionDataForTest) { - builder.disableTouchPositionCorrectionDataForTest(); - } - builder.setProximityCharsCorrectionEnabled(elementParams.mProximityCharsCorrectionEnabled); - final Keyboard keyboard = builder.build(); - sKeyboardCache.put(id, new SoftReference<>(keyboard)); - if ((id.mElementId == KeyboardId.ELEMENT_ALPHABET - || id.mElementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) - && !mParams.mIsSpellChecker) { - // We only forcibly cache the primary, "ALPHABET", layouts. - for (int i = sForcibleKeyboardCache.length - 1; i >= 1; --i) { - sForcibleKeyboardCache[i] = sForcibleKeyboardCache[i - 1]; - } - sForcibleKeyboardCache[0] = keyboard; - if (DEBUG_CACHE) { - Log.d(TAG, "forcing caching of keyboard with id=" + id); - } - } - if (DEBUG_CACHE) { - Log.d(TAG, "keyboard cache size=" + sKeyboardCache.size() + ": " - + ((ref == null) ? "LOAD" : "GCed") + " id=" + id); - } - return keyboard; - } - - public int getScriptId() { - return mParams.mScriptId; - } - - public static final class Builder { - private final Context mContext; - private final String mPackageName; - private final Resources mResources; - - private final Params mParams = new Params(); - - private static final EditorInfo EMPTY_EDITOR_INFO = new EditorInfo(); - - public Builder(final Context context, @Nullable final EditorInfo ei) { - mContext = context; - mPackageName = context.getPackageName(); - mResources = context.getResources(); - final Params params = mParams; - - params.mLongPressKeySettings = new LongPressKeySettings(context); - - final EditorInfo editorInfo = (ei != null) ? ei : EMPTY_EDITOR_INFO; - params.mMode = getKeyboardMode(editorInfo); - // TODO: Consolidate those with {@link InputAttributes}. - params.mEditorInfo = editorInfo; - params.mIsPasswordField = InputTypeUtils.isPasswordInputType(editorInfo.inputType); - params.mNoSettingsKey = InputAttributes.inPrivateImeOptions( - mPackageName, NO_SETTINGS_KEY, editorInfo); - - // When the device is still unlocked, features like showing the IME setting app need to - // be locked down. - // TODO: Switch to {@code UserManagerCompat.isUserUnlocked()} in the support-v4 library - // when it becomes publicly available. - @UserManagerCompatUtils.LockState - final int lockState = UserManagerCompatUtils.getUserLockState(context); - if (lockState == UserManagerCompatUtils.LOCK_STATE_LOCKED) { - params.mNoSettingsKey = true; - } - } - - public Builder setKeyboardGeometry(final int keyboardWidth, final int keyboardHeight) { - mParams.mKeyboardWidth = keyboardWidth; - mParams.mKeyboardHeight = keyboardHeight; - return this; - } - - public Builder setSubtype(@Nonnull final RichInputMethodSubtype subtype) { - final boolean asciiCapable = InputMethodSubtypeCompatUtils.isAsciiCapable(subtype); - // TODO: Consolidate with {@link InputAttributes}. - @SuppressWarnings("deprecation") - final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions( - mPackageName, FORCE_ASCII, mParams.mEditorInfo); - final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii( - mParams.mEditorInfo.imeOptions) - || deprecatedForceAscii; - final RichInputMethodSubtype keyboardSubtype = (forceAscii && !asciiCapable) - ? RichInputMethodSubtype.getNoLanguageSubtype() - : subtype; - mParams.mSubtype = keyboardSubtype; - mParams.mKeyboardLayoutSetName = KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX - + keyboardSubtype.getKeyboardLayoutSetName(); - return this; - } - - public Builder setIsSpellChecker(final boolean isSpellChecker) { - mParams.mIsSpellChecker = isSpellChecker; - return this; - } - - public Builder setVoiceInputKeyEnabled(final boolean enabled) { - mParams.mVoiceInputKeyEnabled = enabled; - return this; - } - - public Builder setBottomActionKey(final boolean enabled, final int action) { - mParams.mBottomEmojiKeyEnabled = enabled; - mParams.mBottomActionKeyId = action; - return this; - } - - public Builder disableTouchPositionCorrectionData() { - mParams.mDisableTouchPositionCorrectionDataForTest = true; - return this; - } - - public Builder setSplitLayoutEnabledByUser(final boolean enabled) { - mParams.mIsSplitLayoutEnabledByUser = enabled; - return this; - } - - public Builder setNumberRow(final boolean enabled) { - mParams.mNumberRow = enabled; - return this; - } - - // Super redux version of reading the script ID for some subtype from Xml. - static int readScriptId(final Resources resources, final InputMethodSubtype subtype) { - final String layoutSetName = KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX - + SubtypeLocaleUtils.getKeyboardLayoutSetName(subtype); - final int xmlId = getXmlId(resources, layoutSetName); - final XmlResourceParser parser = resources.getXml(xmlId); - try { - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - // Bovinate through the XML stupidly searching for TAG_FEATURE, and read - // the script Id from it. - parser.next(); - final String tag = parser.getName(); - if (TAG_FEATURE.equals(tag)) { - return readScriptIdFromTagFeature(resources, parser); - } - } - } catch (final IOException | XmlPullParserException e) { - throw new RuntimeException(e.getMessage() + " in " + layoutSetName, e); - } finally { - parser.close(); - } - // If the tag is not found, then the default script is Latin. - return ScriptUtils.SCRIPT_LATIN; - } - - private static int readScriptIdFromTagFeature(final Resources resources, - final XmlPullParser parser) throws IOException, XmlPullParserException { - final TypedArray featureAttr = resources.obtainAttributes(Xml.asAttributeSet(parser), - R.styleable.KeyboardLayoutSet_Feature); - try { - final int scriptId = - featureAttr.getInt(R.styleable.KeyboardLayoutSet_Feature_supportedScript, - ScriptUtils.SCRIPT_UNKNOWN); - XmlParseUtils.checkEndTag(TAG_FEATURE, parser); - return scriptId; - } finally { - featureAttr.recycle(); - } - } - - public KeyboardLayoutSet build() { - if (mParams.mSubtype == null) - throw new RuntimeException("KeyboardLayoutSet subtype is not specified"); - final int xmlId = getXmlId(mResources, mParams.mKeyboardLayoutSetName); - try { - parseKeyboardLayoutSet(mResources, xmlId); - } catch (final IOException | XmlPullParserException e) { - throw new RuntimeException(e.getMessage() + " in " + mParams.mKeyboardLayoutSetName, - e); - } - return new KeyboardLayoutSet(mContext, mParams); - } - - private static int getXmlId(final Resources resources, final String keyboardLayoutSetName) { - final String packageName = resources.getResourcePackageName( - R.xml.keyboard_layout_set_qwerty); - return resources.getIdentifier(keyboardLayoutSetName, "xml", packageName); - } - - private void parseKeyboardLayoutSet(final Resources res, final int resId) - throws XmlPullParserException, IOException { - final XmlResourceParser parser = res.getXml(resId); - try { - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_KEYBOARD_SET.equals(tag)) { - parseKeyboardLayoutSetContent(parser); - } else { - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_KEYBOARD_SET); - } - } - } - } finally { - parser.close(); - } - } - - private void parseKeyboardLayoutSetContent(final XmlPullParser parser) - throws XmlPullParserException, IOException { - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_ELEMENT.equals(tag)) { - parseKeyboardLayoutSetElement(parser); - } else if (TAG_FEATURE.equals(tag)) { - mParams.mScriptId = readScriptIdFromTagFeature(mResources, parser); - } else { - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_KEYBOARD_SET); - } - } else if (event == XmlPullParser.END_TAG) { - final String tag = parser.getName(); - if (TAG_KEYBOARD_SET.equals(tag)) { - break; - } - throw new XmlParseUtils.IllegalEndTag(parser, tag, TAG_KEYBOARD_SET); - } - } - } - - private void parseKeyboardLayoutSetElement(final XmlPullParser parser) - throws XmlPullParserException, IOException { - final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser), - R.styleable.KeyboardLayoutSet_Element); - try { - XmlParseUtils.checkAttributeExists(a, - R.styleable.KeyboardLayoutSet_Element_elementName, "elementName", - TAG_ELEMENT, parser); - XmlParseUtils.checkAttributeExists(a, - R.styleable.KeyboardLayoutSet_Element_elementKeyboard, "elementKeyboard", - TAG_ELEMENT, parser); - XmlParseUtils.checkEndTag(TAG_ELEMENT, parser); - - final ElementParams elementParams = new ElementParams(); - final int elementName = a.getInt( - R.styleable.KeyboardLayoutSet_Element_elementName, 0); - elementParams.mKeyboardXmlId = a.getResourceId( - R.styleable.KeyboardLayoutSet_Element_elementKeyboard, 0); - elementParams.mProximityCharsCorrectionEnabled = a.getBoolean( - R.styleable.KeyboardLayoutSet_Element_enableProximityCharsCorrection, - false); - elementParams.mSupportsSplitLayout = a.getBoolean( - R.styleable.KeyboardLayoutSet_Element_supportsSplitLayout, false); - elementParams.mAllowRedundantMoreKeys = a.getBoolean( - R.styleable.KeyboardLayoutSet_Element_allowRedundantMoreKeys, false); - mParams.mKeyboardLayoutSetElementIdToParamsMap.put(elementName, elementParams); - } finally { - a.recycle(); - } - } - - private static int getKeyboardMode(final EditorInfo editorInfo) { - final int inputType = editorInfo.inputType; - final int variation = inputType & InputType.TYPE_MASK_VARIATION; - - switch (inputType & InputType.TYPE_MASK_CLASS) { - case InputType.TYPE_CLASS_NUMBER: - return KeyboardId.MODE_NUMBER; - case InputType.TYPE_CLASS_DATETIME: - switch (variation) { - case InputType.TYPE_DATETIME_VARIATION_DATE: - return KeyboardId.MODE_DATE; - case InputType.TYPE_DATETIME_VARIATION_TIME: - return KeyboardId.MODE_TIME; - default: // InputType.TYPE_DATETIME_VARIATION_NORMAL - return KeyboardId.MODE_DATETIME; - } - case InputType.TYPE_CLASS_PHONE: - return KeyboardId.MODE_PHONE; - case InputType.TYPE_CLASS_TEXT: - if (InputTypeUtils.isEmailVariation(variation)) { - return KeyboardId.MODE_EMAIL; - } else if (variation == InputType.TYPE_TEXT_VARIATION_URI) { - return KeyboardId.MODE_URL; - } else if (variation == InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE) { - return KeyboardId.MODE_IM; - } else if (variation == InputType.TYPE_TEXT_VARIATION_FILTER) { - return KeyboardId.MODE_TEXT; - } else { - return KeyboardId.MODE_TEXT; - } - default: - return KeyboardId.MODE_TEXT; - } - } - } -} diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java index 67e5add9e..d0f1de82a 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java @@ -112,7 +112,7 @@ public final class KeyboardSwitcher implements SwitchActions { || !mThemeContext.getResources().equals(context.getResources())) { mKeyboardTheme = keyboardTheme; mThemeContext = new ContextThemeWrapper(context, keyboardTheme.mStyleId); - KeyboardLayoutSet.onKeyboardThemeChanged(); + KeyboardLayoutSetV2.onKeyboardThemeChanged(); themeSwitchPending = false; return true; } diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardView.java b/java/src/org/futo/inputmethod/keyboard/KeyboardView.java index e50db5a3b..8ddea805b 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardView.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardView.java @@ -30,14 +30,11 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.NinePatchDrawable; import android.text.TextUtils; import android.util.AttributeSet; -import android.util.Log; -import android.view.ContextThemeWrapper; import android.view.View; import org.futo.inputmethod.keyboard.internal.KeyDrawParams; import org.futo.inputmethod.keyboard.internal.KeyVisualAttributes; import org.futo.inputmethod.latin.uix.DynamicThemeProvider; -import org.futo.inputmethod.latin.uix.DynamicThemeProviderOwner; import org.futo.inputmethod.latin.R; import org.futo.inputmethod.latin.common.Constants; import org.futo.inputmethod.latin.utils.TypefaceUtils; @@ -138,16 +135,7 @@ public class KeyboardView extends View { final TypedArray keyAttr = context.obtainStyledAttributes(attrs, R.styleable.Keyboard_Key, defStyle, R.style.KeyboardView); - assert(context instanceof ContextThemeWrapper); - - if(((ContextThemeWrapper) context).getBaseContext() instanceof DynamicThemeProviderOwner) { - mDrawableProvider = ((DynamicThemeProviderOwner) ((ContextThemeWrapper) context).getBaseContext()).getDrawableProvider(); - } else if(context instanceof DynamicThemeProviderOwner) { - mDrawableProvider = ((DynamicThemeProviderOwner) context).getDrawableProvider(); - } else { - throw new IllegalStateException("Failed to obtain DynamicThemeProvider"); - } - + mDrawableProvider = DynamicThemeProvider.obtainFromContext(context); boolean isMoreKeys = keyAttr.getBoolean(R.styleable.Keyboard_Key_isMoreKey, false); boolean isMoreKeysAction = keyAttr.getBoolean(R.styleable.Keyboard_Key_isAction, false); diff --git a/java/src/org/futo/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/org/futo/inputmethod/keyboard/MoreKeysKeyboard.java index 7b8dea41b..4cc625398 100644 --- a/java/src/org/futo/inputmethod/keyboard/MoreKeysKeyboard.java +++ b/java/src/org/futo/inputmethod/keyboard/MoreKeysKeyboard.java @@ -17,14 +17,15 @@ package org.futo.inputmethod.keyboard; import android.content.Context; +import android.content.res.Resources; import android.graphics.Paint; import org.futo.inputmethod.annotations.UsedForTesting; -import org.futo.inputmethod.keyboard.internal.KeyboardBuilder; import org.futo.inputmethod.keyboard.internal.KeyboardParams; import org.futo.inputmethod.keyboard.internal.MoreKeySpec; import org.futo.inputmethod.latin.R; import org.futo.inputmethod.latin.common.StringUtils; +import org.futo.inputmethod.latin.uix.DynamicThemeProvider; import org.futo.inputmethod.latin.utils.TypefaceUtils; import java.util.List; @@ -258,12 +259,14 @@ public final class MoreKeysKeyboard extends Keyboard { } } - public static class Builder extends KeyboardBuilder { + public static class Builder { private final Key mParentKey; private static final float LABEL_PADDING_RATIO = 0.2f; private static final float DIVIDER_RATIO = 0.2f; + private MoreKeysKeyboardParams mParams = new MoreKeysKeyboardParams(); + /** * The builder of MoreKeysKeyboard. * @param context the context of {@link MoreKeysKeyboardView}. @@ -278,8 +281,17 @@ public final class MoreKeysKeyboard extends Keyboard { public Builder(final Context context, final Key key, final Keyboard keyboard, final boolean isSingleMoreKeyWithPreview, final int keyPreviewVisibleWidth, final int keyPreviewVisibleHeight, final Paint paintToMeasure) { - super(context, new MoreKeysKeyboardParams()); - load(keyboard.mMoreKeysTemplate, keyboard.mId); + final Resources res = context.getResources(); + mParams.GRID_WIDTH = res.getInteger(R.integer.config_keyboard_grid_width); + mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height); + + DynamicThemeProvider provider = DynamicThemeProvider.obtainFromContext(context); + + mParams.mIconsSet.loadIcons(null, provider); + mParams.mThemeId = 3; + mParams.mTextsSet.setLocale(keyboard.mId.mLocale, context); + + mParams.mProximityCharsCorrectionEnabled = false; // TODO: More keys keyboard's vertical gap is currently calculated heuristically. // Should revise the algorithm. @@ -329,7 +341,6 @@ public final class MoreKeysKeyboard extends Keyboard { return maxWidth; } - @Override @Nonnull public MoreKeysKeyboard build() { final MoreKeysKeyboardParams params = mParams; diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java deleted file mode 100644 index 059cb6514..000000000 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2010 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 org.futo.inputmethod.keyboard.internal; - -import android.content.res.TypedArray; -import android.util.Log; -import android.util.SparseArray; - -import org.futo.inputmethod.latin.R; -import org.futo.inputmethod.latin.utils.XmlParseUtils; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.function.Function; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -public final class KeyStylesSet { - private static final String TAG = KeyStylesSet.class.getSimpleName(); - private static final boolean DEBUG = false; - - @Nonnull - private final HashMap mStyles = new HashMap<>(); - - @Nonnull - private final KeyboardTextsSet mTextsSet; - @Nonnull - private final KeyStyle mEmptyKeyStyle; - @Nonnull - private static final String EMPTY_STYLE_NAME = ""; - - public KeyStylesSet(@Nonnull final KeyboardTextsSet textsSet) { - mTextsSet = textsSet; - mEmptyKeyStyle = new EmptyKeyStyle(textsSet); - mStyles.put(EMPTY_STYLE_NAME, mEmptyKeyStyle); - } - - private static final class EmptyKeyStyle extends KeyStyle { - EmptyKeyStyle(@Nonnull final KeyboardTextsSet textsSet) { - super(textsSet); - } - - @Override - @Nullable - public String[] getStringArray(final TypedArray a, final int index, Function stringMutator) { - return parseStringArray(a, index, stringMutator); - } - - @Override - @Nullable - public String getString(final TypedArray a, final int index, Function stringMutator) { - return parseString(a, index, stringMutator); - } - - @Override - public int getInt(final TypedArray a, final int index, final int defaultValue) { - return a.getInt(index, defaultValue); - } - - @Override - public int getFlags(final TypedArray a, final int index) { - return a.getInt(index, 0); - } - } - - private static final class DeclaredKeyStyle extends KeyStyle { - private final HashMap mStyles; - private final String mParentStyleName; - private final SparseArray mStyleAttributes = new SparseArray<>(); - - public DeclaredKeyStyle(@Nonnull final String parentStyleName, - @Nonnull final KeyboardTextsSet textsSet, - @Nonnull final HashMap styles) { - super(textsSet); - mParentStyleName = parentStyleName; - mStyles = styles; - } - - @Override - @Nullable - public String[] getStringArray(final TypedArray a, final int index, Function stringMutator) { - if (a.hasValue(index)) { - return parseStringArray(a, index, stringMutator); - } - final Object value = mStyleAttributes.get(index); - if (value != null) { - final String[] array = (String[])value; - return Arrays.copyOf(array, array.length); - } - final KeyStyle parentStyle = mStyles.get(mParentStyleName); - return parentStyle.getStringArray(a, index, stringMutator); - } - - @Override - @Nullable - public String getString(final TypedArray a, final int index, Function stringMutator) { - if (a.hasValue(index)) { - return parseString(a, index, stringMutator); - } - final Object value = mStyleAttributes.get(index); - if (value != null) { - return (String)value; - } - final KeyStyle parentStyle = mStyles.get(mParentStyleName); - return parentStyle.getString(a, index, stringMutator); - } - - @Override - public int getInt(final TypedArray a, final int index, final int defaultValue) { - if (a.hasValue(index)) { - return a.getInt(index, defaultValue); - } - final Object value = mStyleAttributes.get(index); - if (value != null) { - return (Integer)value; - } - final KeyStyle parentStyle = mStyles.get(mParentStyleName); - return parentStyle.getInt(a, index, defaultValue); - } - - @Override - public int getFlags(final TypedArray a, final int index) { - final int parentFlags = mStyles.get(mParentStyleName).getFlags(a, index); - final Integer value = (Integer)mStyleAttributes.get(index); - final int styleFlags = (value != null) ? value : 0; - final int flags = a.getInt(index, 0); - return flags | styleFlags | parentFlags; - } - - public void readKeyAttributes(final TypedArray keyAttr) { - // TODO: Currently not all Key attributes can be declared as style. - readString(keyAttr, R.styleable.Keyboard_Key_altCode); - readString(keyAttr, R.styleable.Keyboard_Key_keySpec); - readString(keyAttr, R.styleable.Keyboard_Key_keyHintLabel); - readStringArray(keyAttr, R.styleable.Keyboard_Key_moreKeys); - readStringArray(keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys); - readFlags(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags); - readInt(keyAttr, R.styleable.Keyboard_Key_maxMoreKeysColumn); - readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType); - readFlags(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); - } - - private void readString(final TypedArray a, final int index) { - if (a.hasValue(index)) { - mStyleAttributes.put(index, parseString(a, index, null)); - } - } - - private void readInt(final TypedArray a, final int index) { - if (a.hasValue(index)) { - mStyleAttributes.put(index, a.getInt(index, 0)); - } - } - - private void readFlags(final TypedArray a, final int index) { - if (a.hasValue(index)) { - final Integer value = (Integer)mStyleAttributes.get(index); - final int styleFlags = value != null ? value : 0; - mStyleAttributes.put(index, a.getInt(index, 0) | styleFlags); - } - } - - private void readStringArray(final TypedArray a, final int index) { - if (a.hasValue(index)) { - mStyleAttributes.put(index, parseStringArray(a, index, null)); - } - } - } - - public void parseKeyStyleAttributes(final TypedArray keyStyleAttr, final TypedArray keyAttrs, - final XmlPullParser parser) throws XmlPullParserException { - final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName); - if (styleName == null) { - throw new XmlParseUtils.ParseException( - KeyboardBuilder.TAG_KEY_STYLE + " has no styleName attribute", parser); - } - if (DEBUG) { - Log.d(TAG, String.format("<%s styleName=%s />", - KeyboardBuilder.TAG_KEY_STYLE, styleName)); - if (mStyles.containsKey(styleName)) { - Log.d(TAG, KeyboardBuilder.TAG_KEY_STYLE + " " + styleName + " is overridden at " - + parser.getPositionDescription()); - } - } - - final String parentStyleInAttr = keyStyleAttr.getString( - R.styleable.Keyboard_KeyStyle_parentStyle); - if (parentStyleInAttr != null && !mStyles.containsKey(parentStyleInAttr)) { - throw new XmlParseUtils.ParseException( - "Unknown parentStyle " + parentStyleInAttr, parser); - } - final String parentStyleName = (parentStyleInAttr == null) ? EMPTY_STYLE_NAME - : parentStyleInAttr; - final DeclaredKeyStyle style = new DeclaredKeyStyle(parentStyleName, mTextsSet, mStyles); - style.readKeyAttributes(keyAttrs); - mStyles.put(styleName, style); - } - - @Nonnull - public KeyStyle getKeyStyle(final TypedArray keyAttr, final XmlPullParser parser) - throws XmlParseUtils.ParseException { - final String styleName = keyAttr.getString(R.styleable.Keyboard_Key_keyStyle); - if (styleName == null) { - return mEmptyKeyStyle; - } - final KeyStyle style = mStyles.get(styleName); - if (style == null) { - throw new XmlParseUtils.ParseException("Unknown key style: " + styleName, parser); - } - return style; - } - - public void addDynamicKeyStyle(final String styleName, final String keySpec, final int backgroundType, final int keyActionFlags) { - final DeclaredKeyStyle style = new DeclaredKeyStyle(EMPTY_STYLE_NAME, mTextsSet, mStyles); - style.mStyleAttributes.put(R.styleable.Keyboard_Key_keySpec, mTextsSet.resolveTextReference(keySpec)); - style.mStyleAttributes.put(R.styleable.Keyboard_Key_backgroundType, (backgroundType)); - style.mStyleAttributes.put(R.styleable.Keyboard_Key_keyActionFlags, (keyActionFlags)); - - mStyles.put(styleName, style); - } -} diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java deleted file mode 100644 index 517bdbd03..000000000 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java +++ /dev/null @@ -1,924 +0,0 @@ -/* - * Copyright (C) 2012 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 org.futo.inputmethod.keyboard.internal; - -import android.content.Context; -import android.content.res.Resources; -import android.content.res.TypedArray; -import android.content.res.XmlResourceParser; -import android.os.Build; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.util.Log; -import android.util.TypedValue; -import android.util.Xml; -import android.view.ContextThemeWrapper; - -import org.futo.inputmethod.annotations.UsedForTesting; -import org.futo.inputmethod.keyboard.Key; -import org.futo.inputmethod.keyboard.Keyboard; -import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardTheme; -import org.futo.inputmethod.latin.uix.DynamicThemeProvider; -import org.futo.inputmethod.latin.uix.DynamicThemeProviderOwner; -import org.futo.inputmethod.latin.R; -import org.futo.inputmethod.latin.common.Constants; -import org.futo.inputmethod.latin.common.StringUtils; -import org.futo.inputmethod.latin.utils.ResourceUtils; -import org.futo.inputmethod.latin.utils.XmlParseUtils; -import org.futo.inputmethod.latin.utils.XmlParseUtils.ParseException; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.IOException; -import java.util.Locale; - -import javax.annotation.Nonnull; - -/** - * Keyboard Building helper. - * - * This class parses Keyboard XML file and eventually build a Keyboard. - * The Keyboard XML file looks like: - *
- *   <!-- xml/keyboard.xml -->
- *   <Keyboard keyboard_attributes*>
- *     <!-- Keyboard Content -->
- *     <Row row_attributes*>
- *       <!-- Row Content -->
- *       <Key key_attributes* />
- *       <Spacer horizontalGap="32.0dp" />
- *       <include keyboardLayout="@xml/other_keys">
- *       ...
- *     </Row>
- *     <include keyboardLayout="@xml/other_rows">
- *     ...
- *   </Keyboard>
- * 
- * The XML file which is included in other file must have <merge> as root element, - * such as: - *
- *   <!-- xml/other_keys.xml -->
- *   <merge>
- *     <Key key_attributes* />
- *     ...
- *   </merge>
- * 
- * and - *
- *   <!-- xml/other_rows.xml -->
- *   <merge>
- *     <Row row_attributes*>
- *       <Key key_attributes* />
- *     </Row>
- *     ...
- *   </merge>
- * 
- * You can also use switch-case-default tags to select Rows and Keys. - *
- *   <switch>
- *     <case case_attribute*>
- *       <!-- Any valid tags at switch position -->
- *     </case>
- *     ...
- *     <default>
- *       <!-- Any valid tags at switch position -->
- *     </default>
- *   </switch>
- * 
- * You can declare Key style and specify styles within Key tags. - *
- *     <switch>
- *       <case mode="email">
- *         <key-style styleName="f1-key" parentStyle="modifier-key"
- *           keyLabel=".com"
- *         />
- *       </case>
- *       <case mode="url">
- *         <key-style styleName="f1-key" parentStyle="modifier-key"
- *           keyLabel="http://"
- *         />
- *       </case>
- *     </switch>
- *     ...
- *     <Key keyStyle="shift-key" ... />
- * 
- */ - -// TODO: Remove this class, XML is no longer used for building keyboards -public class KeyboardBuilder { - private static final String BUILDER_TAG = "Keyboard.Builder"; - private static final boolean DEBUG = false; - - // Keyboard XML Tags - private static final String TAG_KEYBOARD = "Keyboard"; - private static final String TAG_ROW = "Row"; - private static final String TAG_GRID_ROWS = "GridRows"; - private static final String TAG_KEY = "Key"; - private static final String TAG_SPACER = "Spacer"; - private static final String TAG_INCLUDE = "include"; - private static final String TAG_MERGE = "merge"; - private static final String TAG_SWITCH = "switch"; - private static final String TAG_CASE = "case"; - private static final String TAG_DEFAULT = "default"; - public static final String TAG_KEY_STYLE = "key-style"; - - private static final int DEFAULT_KEYBOARD_COLUMNS = 10; - private static final int DEFAULT_KEYBOARD_ROWS = 4; - - @Nonnull - protected final KP mParams; - protected final Context mContext; - protected final Resources mResources; - - private int mCurrentY = 0; - private KeyboardRow mCurrentRow = null; - private boolean mLeftEdge; - private boolean mTopEdge; - private Key mRightEdgeKey = null; - - private DynamicThemeProvider mProvider = null; - - public KeyboardBuilder(final Context context, @Nonnull final KP params) { - mContext = context; - if(mContext instanceof DynamicThemeProviderOwner) { - mProvider = ((DynamicThemeProviderOwner) mContext).getDrawableProvider(); - }else if(mContext instanceof ContextThemeWrapper) { - Context baseContext = ((ContextThemeWrapper) mContext).getBaseContext(); - if(baseContext instanceof DynamicThemeProviderOwner) { - mProvider = ((DynamicThemeProviderOwner) baseContext).getDrawableProvider(); - } - } - - final Resources res = context.getResources(); - mResources = res; - - mParams = params; - - params.GRID_WIDTH = res.getInteger(R.integer.config_keyboard_grid_width); - params.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height); - } - - public void setAllowRedundantMoreKes(final boolean enabled) { - mParams.mAllowRedundantMoreKeys = enabled; - } - - public KeyboardBuilder load(final int xmlId, final KeyboardId id) { - mParams.mId = id; - - final String actionKeySpec = "!icon/action_" + id.mBottomActionKeyId + "|!code/action_" + id.mBottomActionKeyId; - mParams.mKeyStyles.addDynamicKeyStyle("bottomEmojiKeyStyle", - actionKeySpec, - 2, - 0x02 | 0x08); - - final XmlResourceParser parser = mResources.getXml(xmlId); - try { - parseKeyboard(parser); - } catch (XmlPullParserException e) { - Log.w(BUILDER_TAG, "keyboard XML parse error", e); - throw new IllegalArgumentException(e.getMessage(), e); - } catch (IOException e) { - Log.w(BUILDER_TAG, "keyboard XML parse error", e); - throw new RuntimeException(e.getMessage(), e); - } finally { - parser.close(); - } - return this; - } - - @UsedForTesting - public void disableTouchPositionCorrectionDataForTest() { - mParams.mTouchPositionCorrection.setEnabled(false); - } - - public void setProximityCharsCorrectionEnabled(final boolean enabled) { - mParams.mProximityCharsCorrectionEnabled = enabled; - } - - @Nonnull - public Keyboard build() { - return new Keyboard(mParams); - } - - private int mIndent; - private static final String SPACES = " "; - - private static String spaces(final int count) { - return (count < SPACES.length()) ? SPACES.substring(0, count) : SPACES; - } - - private void startTag(final String format, final Object ... args) { - Log.d(BUILDER_TAG, String.format(spaces(++mIndent * 2) + format, args)); - } - - private void endTag(final String format, final Object ... args) { - Log.d(BUILDER_TAG, String.format(spaces(mIndent-- * 2) + format, args)); - } - - private void startEndTag(final String format, final Object ... args) { - Log.d(BUILDER_TAG, String.format(spaces(++mIndent * 2) + format, args)); - mIndent--; - } - - private void parseKeyboard(final XmlPullParser parser) - throws XmlPullParserException, IOException { - if (DEBUG) startTag("<%s> %s", TAG_KEYBOARD, mParams.mId); - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_KEYBOARD.equals(tag)) { - parseKeyboardAttributes(parser); - startKeyboard(); - parseKeyboardContent(parser, false); - return; - } - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_KEYBOARD); - } - } - } - - private void parseKeyboardAttributes(final XmlPullParser parser) { - final AttributeSet attr = Xml.asAttributeSet(parser); - final TypedArray keyboardAttr = mContext.obtainStyledAttributes( - attr, R.styleable.Keyboard, R.attr.keyboardStyle, R.style.Keyboard); - final TypedArray keyAttr = mResources.obtainAttributes(attr, R.styleable.Keyboard_Key); - try { - final KeyboardParams params = mParams; - - int extraSidePadding = 0; - int extraBottomPadding = 0; - float heightMultiplier = 1.0f; - float gapMultiplier = 1.0f; - if(params.mIsMainKeyboard) { - extraSidePadding = mResources.getDimensionPixelSize(R.dimen.keyboardSidePaddingAddl); - extraBottomPadding = mResources.getDimensionPixelSize(R.dimen.keyboardBottomPaddingAddl); - heightMultiplier = mProvider.getKeyboardHeightMultiplier() * mResources.getFraction(R.fraction.keyboardHeightMultiplierAddl, 1, 1); - gapMultiplier = mResources.getFraction(R.fraction.keyboardGapMultiplierAddl, 1, 1); - } - - final int height = (int) (params.mId.mHeight * heightMultiplier); - final int width = params.mId.mWidth; - params.mOccupiedHeight = height; - params.mOccupiedWidth = width; - params.mTopPadding = (int)keyboardAttr.getFraction( - R.styleable.Keyboard_keyboardTopPadding, height, height, 0); - params.mBottomPadding = (int)(keyboardAttr.getFraction( - R.styleable.Keyboard_keyboardBottomPadding, height, height, 0) - ) + extraBottomPadding; - - params.mLeftPadding = (int)keyboardAttr.getFraction( - R.styleable.Keyboard_keyboardLeftPadding, width, width, 0) + extraSidePadding; - params.mRightPadding = (int)keyboardAttr.getFraction( - R.styleable.Keyboard_keyboardRightPadding, width, width, 0) + extraSidePadding; - - final int baseWidth = - params.mOccupiedWidth - params.mLeftPadding - params.mRightPadding; - params.mBaseWidth = baseWidth; - params.mDefaultKeyWidth = (int)keyAttr.getFraction(R.styleable.Keyboard_Key_keyWidth, - baseWidth, baseWidth, baseWidth / DEFAULT_KEYBOARD_COLUMNS); - params.mHorizontalGap = (int)(keyboardAttr.getFraction( - R.styleable.Keyboard_horizontalGap, baseWidth, baseWidth, 0) * gapMultiplier); - // TODO: Fix keyboard geometry calculation clearer. Historically vertical gap between - // rows are determined based on the entire keyboard height including top and bottom - // paddings. - params.mVerticalGap = (int)(keyboardAttr.getFraction( - R.styleable.Keyboard_verticalGap, height, height, 0) * gapMultiplier); - final int baseHeight = params.mOccupiedHeight - params.mTopPadding - - params.mBottomPadding + params.mVerticalGap; - params.mBaseHeight = baseHeight; - params.mDefaultRowHeight = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr, - R.styleable.Keyboard_rowHeight, baseHeight, baseHeight / DEFAULT_KEYBOARD_ROWS); - - params.mKeyVisualAttributes = KeyVisualAttributes.newInstance(keyAttr, mProvider); - - params.mMoreKeysTemplate = keyboardAttr.getResourceId( - R.styleable.Keyboard_moreKeysTemplate, 0); - params.mMaxMoreKeysKeyboardColumn = keyAttr.getInt( - R.styleable.Keyboard_Key_maxMoreKeysColumn, 5); - - params.mThemeId = keyboardAttr.getInt(R.styleable.Keyboard_themeId, 0); - params.mIconsSet.loadIcons(keyboardAttr, mProvider); - params.mTextsSet.setLocale(params.mId.getLocale(), mContext); - - final int resourceId = keyboardAttr.getResourceId( - R.styleable.Keyboard_touchPositionCorrectionData, 0); - if (resourceId != 0) { - final String[] data = mResources.getStringArray(resourceId); - params.mTouchPositionCorrection.load(data); - } - } finally { - keyAttr.recycle(); - keyboardAttr.recycle(); - } - } - - private void parseKeyboardContent(final XmlPullParser parser, final boolean skip) - throws XmlPullParserException, IOException { - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_ROW.equals(tag)) { - final KeyboardRow row = parseRowAttributes(parser); - if (DEBUG) startTag("<%s>%s", TAG_ROW, skip ? " skipped" : ""); - if (!skip) { - startRow(row); - } - parseRowContent(parser, row, skip); - } else if (TAG_GRID_ROWS.equals(tag)) { - if (DEBUG) startTag("<%s>%s", TAG_GRID_ROWS, skip ? " skipped" : ""); - parseGridRows(parser, skip); - } else if (TAG_INCLUDE.equals(tag)) { - parseIncludeKeyboardContent(parser, skip); - } else if (TAG_SWITCH.equals(tag)) { - parseSwitchKeyboardContent(parser, skip); - } else if (TAG_KEY_STYLE.equals(tag)) { - parseKeyStyle(parser, skip); - } else { - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_ROW); - } - } else if (event == XmlPullParser.END_TAG) { - final String tag = parser.getName(); - if (DEBUG) endTag("", tag); - if (TAG_KEYBOARD.equals(tag)) { - endKeyboard(); - return; - } - if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag) || TAG_MERGE.equals(tag)) { - return; - } - throw new XmlParseUtils.IllegalEndTag(parser, tag, TAG_ROW); - } - } - } - - private KeyboardRow parseRowAttributes(final XmlPullParser parser) - throws XmlPullParserException { - final AttributeSet attr = Xml.asAttributeSet(parser); - final TypedArray keyboardAttr = mResources.obtainAttributes(attr, R.styleable.Keyboard); - try { - if (keyboardAttr.hasValue(R.styleable.Keyboard_horizontalGap)) { - throw new XmlParseUtils.IllegalAttribute(parser, TAG_ROW, "horizontalGap"); - } - if (keyboardAttr.hasValue(R.styleable.Keyboard_verticalGap)) { - throw new XmlParseUtils.IllegalAttribute(parser, TAG_ROW, "verticalGap"); - } - return new KeyboardRow(mResources, mParams, parser, mCurrentY); - } finally { - keyboardAttr.recycle(); - } - } - - private void parseRowContent(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_KEY.equals(tag)) { - parseKey(parser, row, skip); - } else if (TAG_SPACER.equals(tag)) { - parseSpacer(parser, row, skip); - } else if (TAG_INCLUDE.equals(tag)) { - parseIncludeRowContent(parser, row, skip); - } else if (TAG_SWITCH.equals(tag)) { - parseSwitchRowContent(parser, row, skip); - } else if (TAG_KEY_STYLE.equals(tag)) { - parseKeyStyle(parser, skip); - } else { - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_ROW); - } - } else if (event == XmlPullParser.END_TAG) { - final String tag = parser.getName(); - if (DEBUG) endTag("", tag); - if (TAG_ROW.equals(tag)) { - if (!skip) { - endRow(row); - } - return; - } - if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag) || TAG_MERGE.equals(tag)) { - return; - } - throw new XmlParseUtils.IllegalEndTag(parser, tag, TAG_ROW); - } - } - } - - private void parseGridRows(final XmlPullParser parser, final boolean skip) - throws XmlPullParserException, IOException { - if (skip) { - XmlParseUtils.checkEndTag(TAG_GRID_ROWS, parser); - if (DEBUG) { - startEndTag("<%s /> skipped", TAG_GRID_ROWS); - } - return; - } - final KeyboardRow gridRows = new KeyboardRow(mResources, mParams, parser, mCurrentY); - final TypedArray gridRowAttr = mResources.obtainAttributes( - Xml.asAttributeSet(parser), R.styleable.Keyboard_GridRows); - final int codesArrayId = gridRowAttr.getResourceId( - R.styleable.Keyboard_GridRows_codesArray, 0); - final int textsArrayId = gridRowAttr.getResourceId( - R.styleable.Keyboard_GridRows_textsArray, 0); - gridRowAttr.recycle(); - if (codesArrayId == 0 && textsArrayId == 0) { - throw new XmlParseUtils.ParseException( - "Missing codesArray or textsArray attributes", parser); - } - if (codesArrayId != 0 && textsArrayId != 0) { - throw new XmlParseUtils.ParseException( - "Both codesArray and textsArray attributes specifed", parser); - } - final String[] array = mResources.getStringArray( - codesArrayId != 0 ? codesArrayId : textsArrayId); - final int counts = array.length; - final float keyWidth = gridRows.getKeyWidth(null, 0.0f); - final int numColumns = (int)(mParams.mOccupiedWidth / keyWidth); - for (int index = 0; index < counts; index += numColumns) { - final KeyboardRow row = new KeyboardRow(mResources, mParams, parser, mCurrentY); - startRow(row); - for (int c = 0; c < numColumns; c++) { - final int i = index + c; - if (i >= counts) { - break; - } - final String label; - final int code; - final String outputText; - final int supportedMinSdkVersion; - if (codesArrayId != 0) { - final String codeArraySpec = array[i]; - label = CodesArrayParser.parseLabel(codeArraySpec); - code = CodesArrayParser.parseCode(codeArraySpec); - outputText = CodesArrayParser.parseOutputText(codeArraySpec); - supportedMinSdkVersion = - CodesArrayParser.getMinSupportSdkVersion(codeArraySpec); - } else { - final String textArraySpec = array[i]; - // TODO: Utilize KeySpecParser or write more generic TextsArrayParser. - label = textArraySpec; - code = Constants.CODE_OUTPUT_TEXT; - outputText = textArraySpec + (char)Constants.CODE_SPACE; - supportedMinSdkVersion = 0; - } - if (Build.VERSION.SDK_INT < supportedMinSdkVersion) { - continue; - } - final int labelFlags = row.getDefaultKeyLabelFlags(); - // TODO: Should be able to assign default keyActionFlags as well. - final int backgroundType = row.getDefaultBackgroundType(); - final int x = (int)row.getKeyX(null); - final int y = row.getKeyY(); - final int width = (int)keyWidth; - final int height = row.getRowHeight(); - //final Key key = new Key(label, KeyboardIconsSet.ICON_UNDEFINED, code, outputText, - // null /* hintLabel */, labelFlags, backgroundType, x, y, width, height, - // mParams.mHorizontalGap, mParams.mVerticalGap, KeyConsts.ACTION_FLAGS_NO_KEY_PREVIEW); - //endKey(key); - row.advanceXPos(keyWidth); - } - endRow(row); - } - - XmlParseUtils.checkEndTag(TAG_GRID_ROWS, parser); - } - - private void parseKey(final XmlPullParser parser, final KeyboardRow row, final boolean skip) - throws XmlPullParserException, IOException { - if (skip) { - XmlParseUtils.checkEndTag(TAG_KEY, parser); - if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY); - return; - } - final TypedArray keyAttr = mResources.obtainAttributes( - Xml.asAttributeSet(parser), R.styleable.Keyboard_Key); - final KeyStyle keyStyle = mParams.mKeyStyles.getKeyStyle(keyAttr, parser); - final String keySpec = keyStyle.getString(keyAttr, R.styleable.Keyboard_Key_keySpec, null); - if (TextUtils.isEmpty(keySpec)) { - throw new ParseException("Empty keySpec", parser); - } - //final Key key = new Key(keySpec, keyAttr, keyStyle, mParams, row); - keyAttr.recycle(); - //if (DEBUG) { - // startEndTag("<%s%s %s moreKeys=%s />", TAG_KEY, (key.isEnabled() ? "" : " disabled"), - // key, Arrays.toString(key.getMoreKeys())); - //} - XmlParseUtils.checkEndTag(TAG_KEY, parser); - //endKey(key); - } - - private void parseSpacer(final XmlPullParser parser, final KeyboardRow row, final boolean skip) - throws XmlPullParserException, IOException { - if (skip) { - XmlParseUtils.checkEndTag(TAG_SPACER, parser); - if (DEBUG) startEndTag("<%s /> skipped", TAG_SPACER); - return; - } - final TypedArray keyAttr = mResources.obtainAttributes( - Xml.asAttributeSet(parser), R.styleable.Keyboard_Key); - final KeyStyle keyStyle = mParams.mKeyStyles.getKeyStyle(keyAttr, parser); - //final Key spacer = new Key.Spacer(keyAttr, keyStyle, mParams, row); - keyAttr.recycle(); - if (DEBUG) startEndTag("<%s />", TAG_SPACER); - XmlParseUtils.checkEndTag(TAG_SPACER, parser); - //endKey(spacer); - } - - private void parseIncludeKeyboardContent(final XmlPullParser parser, final boolean skip) - throws XmlPullParserException, IOException { - parseIncludeInternal(parser, null, skip); - } - - private void parseIncludeRowContent(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - parseIncludeInternal(parser, row, skip); - } - - private void parseIncludeInternal(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - if (skip) { - XmlParseUtils.checkEndTag(TAG_INCLUDE, parser); - if (DEBUG) startEndTag(" skipped", TAG_INCLUDE); - return; - } - final AttributeSet attr = Xml.asAttributeSet(parser); - final TypedArray keyboardAttr = mResources.obtainAttributes( - attr, R.styleable.Keyboard_Include); - final TypedArray keyAttr = mResources.obtainAttributes(attr, R.styleable.Keyboard_Key); - int keyboardLayout = 0; - try { - XmlParseUtils.checkAttributeExists( - keyboardAttr, R.styleable.Keyboard_Include_keyboardLayout, "keyboardLayout", - TAG_INCLUDE, parser); - keyboardLayout = keyboardAttr.getResourceId( - R.styleable.Keyboard_Include_keyboardLayout, 0); - if (row != null) { - // Override current x coordinate. - row.setXPos(row.getKeyX(keyAttr)); - // Push current Row attributes and update with new attributes. - row.pushRowAttributes(keyAttr); - } - } finally { - keyboardAttr.recycle(); - keyAttr.recycle(); - } - - XmlParseUtils.checkEndTag(TAG_INCLUDE, parser); - if (DEBUG) { - startEndTag("<%s keyboardLayout=%s />",TAG_INCLUDE, - mResources.getResourceEntryName(keyboardLayout)); - } - final XmlResourceParser parserForInclude = mResources.getXml(keyboardLayout); - try { - parseMerge(parserForInclude, row, skip); - } finally { - if (row != null) { - // Restore Row attributes. - row.popRowAttributes(); - } - parserForInclude.close(); - } - } - - private void parseMerge(final XmlPullParser parser, final KeyboardRow row, final boolean skip) - throws XmlPullParserException, IOException { - if (DEBUG) startTag("<%s>", TAG_MERGE); - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_MERGE.equals(tag)) { - if (row == null) { - parseKeyboardContent(parser, skip); - } else { - parseRowContent(parser, row, skip); - } - return; - } - throw new XmlParseUtils.ParseException( - "Included keyboard layout must have root element", parser); - } - } - } - - private void parseSwitchKeyboardContent(final XmlPullParser parser, final boolean skip) - throws XmlPullParserException, IOException { - parseSwitchInternal(parser, null, skip); - } - - private void parseSwitchRowContent(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - parseSwitchInternal(parser, row, skip); - } - - private void parseSwitchInternal(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - if (DEBUG) startTag("<%s> %s", TAG_SWITCH, mParams.mId); - boolean selected = false; - while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - final int event = parser.next(); - if (event == XmlPullParser.START_TAG) { - final String tag = parser.getName(); - if (TAG_CASE.equals(tag)) { - selected |= parseCase(parser, row, selected ? true : skip); - } else if (TAG_DEFAULT.equals(tag)) { - selected |= parseDefault(parser, row, selected ? true : skip); - } else { - throw new XmlParseUtils.IllegalStartTag(parser, tag, TAG_SWITCH); - } - } else if (event == XmlPullParser.END_TAG) { - final String tag = parser.getName(); - if (TAG_SWITCH.equals(tag)) { - if (DEBUG) endTag("", TAG_SWITCH); - return; - } - throw new XmlParseUtils.IllegalEndTag(parser, tag, TAG_SWITCH); - } - } - } - - private boolean parseCase(final XmlPullParser parser, final KeyboardRow row, final boolean skip) - throws XmlPullParserException, IOException { - final boolean selected = parseCaseCondition(parser); - if (row == null) { - // Processing Rows. - parseKeyboardContent(parser, selected ? skip : true); - } else { - // Processing Keys. - parseRowContent(parser, row, selected ? skip : true); - } - return selected; - } - - private boolean parseCaseCondition(final XmlPullParser parser) { - final KeyboardId id = mParams.mId; - if (id == null) { - return true; - } - final AttributeSet attr = Xml.asAttributeSet(parser); - final TypedArray caseAttr = mResources.obtainAttributes(attr, R.styleable.Keyboard_Case); - try { - final boolean keyboardLayoutSetMatched = matchString(caseAttr, - R.styleable.Keyboard_Case_keyboardLayoutSet, - id.mKeyboardLayoutSetName); - final boolean keyboardLayoutSetElementMatched = matchTypedValue(caseAttr, - R.styleable.Keyboard_Case_keyboardLayoutSetElement, id.mElementId, - KeyboardId.elementIdToName(id.mElementId)); - final boolean keyboardThemeMacthed = matchTypedValue(caseAttr, - R.styleable.Keyboard_Case_keyboardTheme, mParams.mThemeId, - KeyboardTheme.getKeyboardThemeName(mParams.mThemeId)); - final boolean modeMatched = matchTypedValue(caseAttr, - R.styleable.Keyboard_Case_mode, id.mMode, KeyboardId.modeName(id.mMode)); - final boolean navigateNextMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_navigateNext, id.navigateNext()); - final boolean navigatePreviousMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_navigatePrevious, id.navigatePrevious()); - final boolean passwordInputMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_passwordInput, id.passwordInput()); - final boolean clobberSettingsKeyMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey); - final boolean hasShortcutKeyMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey); - final boolean languageSwitchKeyEnabledMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_bottomEmojiKeyEnabled, - id.mBottomEmojiKeyEnabled); - final boolean isMultiLineMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_isMultiLine, id.isMultiLine()); - final boolean imeActionMatched = matchInteger(caseAttr, - R.styleable.Keyboard_Case_imeAction, id.imeAction()); - final boolean isIconDefinedMatched = isIconDefined(caseAttr, - R.styleable.Keyboard_Case_isIconDefined, mParams.mIconsSet); - final Locale locale = id.getLocale(); - final boolean localeCodeMatched = matchLocaleCodes(caseAttr, locale); - final boolean languageCodeMatched = matchLanguageCodes(caseAttr, locale); - final boolean countryCodeMatched = matchCountryCodes(caseAttr, locale); - final boolean splitLayoutMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_isSplitLayout, id.mIsSplitLayout); - final boolean numberRowMatched = matchBoolean(caseAttr, - R.styleable.Keyboard_Case_numberRow, id.mNumberRow); - final boolean selected = keyboardLayoutSetMatched && keyboardLayoutSetElementMatched - && keyboardThemeMacthed && modeMatched && navigateNextMatched - && navigatePreviousMatched && passwordInputMatched && clobberSettingsKeyMatched - && hasShortcutKeyMatched && languageSwitchKeyEnabledMatched - && isMultiLineMatched && imeActionMatched && isIconDefinedMatched - && localeCodeMatched && languageCodeMatched && countryCodeMatched - && splitLayoutMatched && numberRowMatched; - - if (DEBUG) { - startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, - textAttr(caseAttr.getString( - R.styleable.Keyboard_Case_keyboardLayoutSet), "keyboardLayoutSet"), - textAttr(caseAttr.getString( - R.styleable.Keyboard_Case_keyboardLayoutSetElement), - "keyboardLayoutSetElement"), - textAttr(caseAttr.getString( - R.styleable.Keyboard_Case_keyboardTheme), "keyboardTheme"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_mode), "mode"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_imeAction), - "imeAction"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_navigateNext, - "navigateNext"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_navigatePrevious, - "navigatePrevious"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_clobberSettingsKey, - "clobberSettingsKey"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_passwordInput, - "passwordInput"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_hasShortcutKey, - "hasShortcutKey"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_bottomEmojiKeyEnabled, - "bottomEmojiKeyEnabled"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_isMultiLine, - "isMultiLine"), - booleanAttr(caseAttr, R.styleable.Keyboard_Case_isSplitLayout, - "splitLayout"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_isIconDefined), - "isIconDefined"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_localeCode), - "localeCode"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_languageCode), - "languageCode"), - textAttr(caseAttr.getString(R.styleable.Keyboard_Case_countryCode), - "countryCode"), - selected ? "" : " skipped"); - } - - return selected; - } finally { - caseAttr.recycle(); - } - } - - private static boolean matchLocaleCodes(TypedArray caseAttr, final Locale locale) { - return matchString(caseAttr, R.styleable.Keyboard_Case_localeCode, locale.toString()); - } - - private static boolean matchLanguageCodes(TypedArray caseAttr, Locale locale) { - return matchString(caseAttr, R.styleable.Keyboard_Case_languageCode, locale.getLanguage()); - } - - private static boolean matchCountryCodes(TypedArray caseAttr, Locale locale) { - return matchString(caseAttr, R.styleable.Keyboard_Case_countryCode, locale.getCountry()); - } - - private static boolean matchInteger(final TypedArray a, final int index, final int value) { - // If does not have "index" attribute, that means this is wild-card for - // the attribute. - return !a.hasValue(index) || a.getInt(index, 0) == value; - } - - private static boolean matchBoolean(final TypedArray a, final int index, final boolean value) { - // If does not have "index" attribute, that means this is wild-card for - // the attribute. - return !a.hasValue(index) || a.getBoolean(index, false) == value; - } - - private static boolean matchString(final TypedArray a, final int index, final String value) { - // If does not have "index" attribute, that means this is wild-card for - // the attribute. - return !a.hasValue(index) - || StringUtils.containsInArray(value, a.getString(index).split("\\|")); - } - - private static boolean matchTypedValue(final TypedArray a, final int index, final int intValue, - final String strValue) { - // If does not have "index" attribute, that means this is wild-card for - // the attribute. - final TypedValue v = a.peekValue(index); - if (v == null) { - return true; - } - if (ResourceUtils.isIntegerValue(v)) { - return intValue == a.getInt(index, 0); - } - if (ResourceUtils.isStringValue(v)) { - return StringUtils.containsInArray(strValue, a.getString(index).split("\\|")); - } - return false; - } - - private static boolean isIconDefined(final TypedArray a, final int index, - final KeyboardIconsSet iconsSet) { - if (!a.hasValue(index)) { - return true; - } - final String iconName = a.getString(index); - return iconsSet.getIconDrawable(iconName) != null; - } - - private boolean parseDefault(final XmlPullParser parser, final KeyboardRow row, - final boolean skip) throws XmlPullParserException, IOException { - if (DEBUG) startTag("<%s>", TAG_DEFAULT); - if (row == null) { - parseKeyboardContent(parser, skip); - } else { - parseRowContent(parser, row, skip); - } - return true; - } - - private void parseKeyStyle(final XmlPullParser parser, final boolean skip) - throws XmlPullParserException, IOException { - final AttributeSet attr = Xml.asAttributeSet(parser); - final TypedArray keyStyleAttr = mResources.obtainAttributes( - attr, R.styleable.Keyboard_KeyStyle); - final TypedArray keyAttrs = mResources.obtainAttributes(attr, R.styleable.Keyboard_Key); - try { - if (!keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_styleName)) { - throw new XmlParseUtils.ParseException("<" + TAG_KEY_STYLE - + "/> needs styleName attribute", parser); - } - if (DEBUG) { - startEndTag("<%s styleName=%s />%s", TAG_KEY_STYLE, - keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName), - skip ? " skipped" : ""); - } - if (!skip) { - mParams.mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser); - } - } finally { - keyStyleAttr.recycle(); - keyAttrs.recycle(); - } - XmlParseUtils.checkEndTag(TAG_KEY_STYLE, parser); - } - - private void startKeyboard() { - mCurrentY += mParams.mTopPadding; - mTopEdge = true; - } - - private void startRow(final KeyboardRow row) { - addEdgeSpace(mParams.mLeftPadding, row); - mCurrentRow = row; - mLeftEdge = true; - mRightEdgeKey = null; - } - - private void endRow(final KeyboardRow row) { - if (mCurrentRow == null) { - throw new RuntimeException("orphan end row tag"); - } - if (mRightEdgeKey != null) { - mRightEdgeKey.markAsRightEdge(mParams); - mRightEdgeKey = null; - } - addEdgeSpace(mParams.mRightPadding, row); - mCurrentY += row.getRowHeight(); - mCurrentRow = null; - mTopEdge = false; - } - - private void endKey(@Nonnull final Key key) { - mParams.onAddKey(key); - if (mLeftEdge) { - key.markAsLeftEdge(mParams); - mLeftEdge = false; - } - if (mTopEdge) { - key.markAsTopEdge(mParams); - } - mRightEdgeKey = key; - } - - private void endKeyboard() { - mParams.removeRedundantMoreKeys(); - // {@link #parseGridRows(XmlPullParser,boolean)} may populate keyboard rows higher than - // previously expected. - final int actualHeight = mCurrentY - mParams.mVerticalGap + mParams.mBottomPadding; - mParams.mOccupiedHeight = Math.max(mParams.mOccupiedHeight, actualHeight); - } - - private void addEdgeSpace(final float width, final KeyboardRow row) { - row.advanceXPos(width); - mLeftEdge = false; - mRightEdgeKey = null; - } - - private static String textAttr(final String value, final String name) { - return value != null ? String.format(" %s=%s", name, value) : ""; - } - - private static String booleanAttr(final TypedArray a, final int index, final String name) { - return a.hasValue(index) - ? String.format(" %s=%s", name, a.getBoolean(index, false)) : ""; - } -} diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardParams.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardParams.java index 4185c6e0a..6fbfb3e43 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardParams.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardParams.java @@ -76,8 +76,6 @@ public class KeyboardParams { public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); @Nonnull public final KeyboardTextsSet mTextsSet = new KeyboardTextsSet(); - @Nonnull - public final KeyStylesSet mKeyStyles = new KeyStylesSet(mTextsSet); @Nonnull private final UniqueKeysCache mUniqueKeysCache; diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardRow.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardRow.java deleted file mode 100644 index e2c181dd6..000000000 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardRow.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2012 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 org.futo.inputmethod.keyboard.internal; - -import android.content.res.Resources; -import android.content.res.TypedArray; -import android.util.Xml; - -import org.futo.inputmethod.keyboard.KeyConsts; -import org.futo.inputmethod.keyboard.Keyboard; -import org.futo.inputmethod.latin.R; -import org.futo.inputmethod.latin.utils.ResourceUtils; - -import org.xmlpull.v1.XmlPullParser; - -import java.util.ArrayDeque; - -/** - * Container for keys in the keyboard. All keys in a row are at the same Y-coordinate. - * Some of the key size defaults can be overridden per row from what the {@link Keyboard} - * defines. - */ -// TODO: Remove this class, it is no longer used -public final class KeyboardRow { - // keyWidth enum constants - private static final int KEYWIDTH_NOT_ENUM = 0; - private static final int KEYWIDTH_FILL_RIGHT = -1; - - private final KeyboardParams mParams; - /** The height of this row. */ - private final int mRowHeight; - - private final ArrayDeque mRowAttributesStack = new ArrayDeque<>(); - - // TODO: Add keyActionFlags. - private static class RowAttributes { - /** Default width of a key in this row. */ - public final float mDefaultKeyWidth; - /** Default keyLabelFlags in this row. */ - public final int mDefaultKeyLabelFlags; - /** Default backgroundType for this row */ - public final int mDefaultBackgroundType; - - /** - * Parse and create key attributes. This constructor is used to parse Row tag. - * - * @param keyAttr an attributes array of Row tag. - * @param defaultKeyWidth a default key width. - * @param keyboardWidth the keyboard width that is required to calculate keyWidth attribute. - */ - public RowAttributes(final TypedArray keyAttr, final float defaultKeyWidth, - final int keyboardWidth) { - mDefaultKeyWidth = keyAttr.getFraction(R.styleable.Keyboard_Key_keyWidth, - keyboardWidth, keyboardWidth, defaultKeyWidth); - mDefaultKeyLabelFlags = keyAttr.getInt(R.styleable.Keyboard_Key_keyLabelFlags, 0); - mDefaultBackgroundType = keyAttr.getInt(R.styleable.Keyboard_Key_backgroundType, - KeyConsts.BACKGROUND_TYPE_NORMAL); - } - - /** - * Parse and update key attributes using default attributes. This constructor is used - * to parse include tag. - * - * @param keyAttr an attributes array of include tag. - * @param defaultRowAttr default Row attributes. - * @param keyboardWidth the keyboard width that is required to calculate keyWidth attribute. - */ - public RowAttributes(final TypedArray keyAttr, final RowAttributes defaultRowAttr, - final int keyboardWidth) { - mDefaultKeyWidth = keyAttr.getFraction(R.styleable.Keyboard_Key_keyWidth, - keyboardWidth, keyboardWidth, defaultRowAttr.mDefaultKeyWidth); - mDefaultKeyLabelFlags = keyAttr.getInt(R.styleable.Keyboard_Key_keyLabelFlags, 0) - | defaultRowAttr.mDefaultKeyLabelFlags; - mDefaultBackgroundType = keyAttr.getInt(R.styleable.Keyboard_Key_backgroundType, - defaultRowAttr.mDefaultBackgroundType); - } - } - - private final int mCurrentY; - // Will be updated by {@link Key}'s constructor. - private float mCurrentX; - - public KeyboardRow(final Resources res, final KeyboardParams params, - final XmlPullParser parser, final int y) { - mParams = params; - final TypedArray keyboardAttr = res.obtainAttributes(Xml.asAttributeSet(parser), - R.styleable.Keyboard); - mRowHeight = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr, - R.styleable.Keyboard_rowHeight, params.mBaseHeight, params.mDefaultRowHeight); - keyboardAttr.recycle(); - final TypedArray keyAttr = res.obtainAttributes(Xml.asAttributeSet(parser), - R.styleable.Keyboard_Key); - mRowAttributesStack.push(new RowAttributes( - keyAttr, params.mDefaultKeyWidth, params.mBaseWidth)); - keyAttr.recycle(); - - mCurrentY = y; - mCurrentX = 0.0f; - } - - public int getRowHeight() { - return mRowHeight; - } - - public void pushRowAttributes(final TypedArray keyAttr) { - final RowAttributes newAttributes = new RowAttributes( - keyAttr, mRowAttributesStack.peek(), mParams.mBaseWidth); - mRowAttributesStack.push(newAttributes); - } - - public void popRowAttributes() { - mRowAttributesStack.pop(); - } - - public float getDefaultKeyWidth() { - return mRowAttributesStack.peek().mDefaultKeyWidth; - } - - public int getDefaultKeyLabelFlags() { - return mRowAttributesStack.peek().mDefaultKeyLabelFlags; - } - - public int getDefaultBackgroundType() { - return mRowAttributesStack.peek().mDefaultBackgroundType; - } - - public void setXPos(final float keyXPos) { - mCurrentX = keyXPos; - } - - public void advanceXPos(final float width) { - mCurrentX += width; - } - - public int getKeyY() { - return mCurrentY; - } - - public float getKeyX(final TypedArray keyAttr) { - if (keyAttr == null || !keyAttr.hasValue(R.styleable.Keyboard_Key_keyXPos)) { - return mCurrentX; - } - final float keyXPos = keyAttr.getFraction(R.styleable.Keyboard_Key_keyXPos, - mParams.mBaseWidth, mParams.mBaseWidth, 0); - if (keyXPos >= 0) { - return keyXPos + mParams.mLeftPadding; - } - // If keyXPos is negative, the actual x-coordinate will be - // keyboardWidth + keyXPos. - // keyXPos shouldn't be less than mCurrentX because drawable area for this - // key starts at mCurrentX. Or, this key will overlaps the adjacent key on - // its left hand side. - final int keyboardRightEdge = mParams.mOccupiedWidth - mParams.mRightPadding; - return Math.max(keyXPos + keyboardRightEdge, mCurrentX); - } - - public float getKeyWidth(final TypedArray keyAttr, final float keyXPos) { - if (keyAttr == null) { - return getDefaultKeyWidth(); - } - final int widthType = ResourceUtils.getEnumValue(keyAttr, - R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM); - switch (widthType) { - case KEYWIDTH_FILL_RIGHT: - // If keyWidth is fillRight, the actual key width will be determined to fill - // out the area up to the right edge of the keyboard. - final int keyboardRightEdge = mParams.mOccupiedWidth - mParams.mRightPadding; - return keyboardRightEdge - keyXPos; - default: // KEYWIDTH_NOT_ENUM - return keyAttr.getFraction(R.styleable.Keyboard_Key_keyWidth, - mParams.mBaseWidth, mParams.mBaseWidth, getDefaultKeyWidth()); - } - } -} diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java index ea8971b54..303ace6c0 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -89,285 +89,285 @@ public final class KeyboardTextsTable { "morekeys_c", "keyspec_currency", "morekeys_s", - "morekeys_misc_o", "morekeys_misc_a", + "morekeys_misc_o", "morekeys_misc_u", "morekeys_misc_e", - "morekeys_z", "morekeys_n", + "morekeys_z", "morekeys_misc_i", - "morekeys_misc_c", "morekeys_misc_s", - "single_angle_quotes", + "morekeys_misc_c", "double_angle_quotes", + "single_angle_quotes", "morekeys_y", "additional_morekeys_symbols_3", - "additional_morekeys_symbols_8", - "morekeys_d", - "additional_morekeys_symbols_7", - "keyspec_symbols_1", - "keyspec_symbols_0", - "additional_morekeys_symbols_5", - "keyspec_symbols_4", - "keyspec_symbols_6", "additional_morekeys_symbols_2", - "additional_morekeys_symbols_9", - "morekeys_misc_z", - "additional_morekeys_symbols_1", + "additional_morekeys_symbols_8", "keyspec_symbols_3", - "keyspec_symbols_7", - "keyspec_symbols_8", - "keyspec_symbols_2", - "keyspec_symbols_9", "keyspec_symbols_5", - "additional_morekeys_symbols_0", + "morekeys_d", + "keyspec_symbols_9", + "keyspec_symbols_8", "additional_morekeys_symbols_4", - "additional_morekeys_symbols_6", + "keyspec_symbols_0", + "keyspec_symbols_6", + "keyspec_symbols_4", + "keyspec_symbols_2", + "keyspec_symbols_7", "morekeys_g", + "keyspec_symbols_1", + "morekeys_misc_z", + "additional_morekeys_symbols_6", + "additional_morekeys_symbols_5", + "additional_morekeys_symbols_0", + "additional_morekeys_symbols_9", + "additional_morekeys_symbols_7", + "additional_morekeys_symbols_1", "morekeys_tablet_period", - "keylabel_to_symbol", "morekeys_cyrillic_ie", - "keyspec_nordic_row2_10", - "morekeys_cyrillic_soft_sign", - "keyspec_east_slavic_row2_11", - "keyspec_east_slavic_row2_2", - "keyspec_nordic_row1_11", - "keyspec_nordic_row2_11", - "morekeys_period", + "keylabel_to_symbol", "keyspec_east_slavic_row3_5", - "keyspec_east_slavic_row1_9", - "morekeys_misc_n", + "keyspec_nordic_row1_11", + "keyspec_east_slavic_row2_2", "morekeys_t", - "morekeys_nordic_row2_10", - "keyspec_period", + "morekeys_period", + "keyspec_nordic_row2_11", + "keyspec_nordic_row2_10", + "keyspec_east_slavic_row2_11", "keyspec_tablet_comma", - "keyspec_right_single_angle_quote", + "morekeys_nordic_row2_10", + "morekeys_cyrillic_soft_sign", + "keyspec_east_slavic_row1_9", + "keyspec_period", + "morekeys_misc_n", + "keyspec_less_than", + "morekeys_l", + "morekeys_r", + "keyspec_right_double_angle_quote", + "keyspec_less_than_equal", + "morekeys_punctuation", + "keyspec_left_curly_bracket", + "keyspec_comma", + "morekeys_question", + "keyspec_left_double_angle_quote", "keyspec_left_parenthesis", - "keyhintlabel_period", - "keyspec_tablet_period", + "morekeys_nordic_row2_11", "keyspec_greater_than", "morekeys_tablet_comma", - "keyspec_less_than_equal", - "keyspec_right_parenthesis", - "keyspec_less_than", - "keyspec_left_square_bracket", - "keyspec_comma", "keyspec_right_square_bracket", - "keyspec_right_curly_bracket", - "keyspec_right_double_angle_quote", - "morekeys_r", - "morekeys_nordic_row2_11", - "morekeys_question", "morekeys_star", - "morekeys_punctuation", - "keyspec_left_double_angle_quote", - "morekeys_l", "keyspec_left_single_angle_quote", - "keyspec_left_curly_bracket", + "keyspec_tablet_period", + "keyspec_right_parenthesis", "keyspec_greater_than_equal", + "keyspec_left_square_bracket", + "keyhintlabel_period", + "keyspec_right_single_angle_quote", + "keyspec_right_curly_bracket", + "keyhintlabel_tablet_period", + "keyspec_spanish_row2_10", + "morekeys_misc_y", + "morekeys_symbols_percent", + "morekeys_bullet", + "keyspec_symbols_percent", + "keyhintlabel_tablet_comma", + "morekeys_right_parenthesis", + "keyspec_symbols_question", + "morekeys_symbols_semicolon", + "keyspec_swiss_row1_11", + "keyspec_symbols_semicolon", + "morekeys_swiss_row2_10", + "morekeys_arabic_diacritics", + "keyspec_swiss_row2_10", + "keyspec_swiss_row2_11", "morekeys_left_parenthesis", "morekeys_swiss_row1_11", - "keyhintlabel_tablet_comma", - "morekeys_symbols_percent", - "keyspec_swiss_row1_11", - "morekeys_bullet", - "morekeys_symbols_semicolon", - "keyspec_swiss_row2_11", - "keyspec_symbols_question", - "morekeys_right_parenthesis", "morekeys_swiss_row2_11", - "morekeys_misc_y", - "keyspec_symbols_percent", - "keyspec_spanish_row2_10", - "keyhintlabel_tablet_period", - "keyspec_symbols_semicolon", - "keyspec_swiss_row2_10", - "morekeys_arabic_diacritics", - "morekeys_swiss_row2_10", - "morekeys_h", - "morekeys_k", - "label_wait_key", - "keyspec_south_slavic_row1_6", - "morekeys_cyrillic_en", - "label_done_key", "morekeys_cyrillic_i", - "keyspec_south_slavic_row3_8", - "label_previous_key", - "morekeys_misc_l", - "label_send_key", - "label_next_key", - "morekeys_misc_r", - "morekeys_misc_g", - "morekeys_cyrillic_o", - "label_go_key", - "morekeys_east_slavic_row2_2", - "morekeys_cyrillic_u", - "label_search_key", - "label_pause_key", - "keyspec_south_slavic_row3_1", + "label_wait_key", "morekeys_cyrillic_ghe", + "morekeys_cyrillic_en", + "morekeys_cyrillic_u", + "keyspec_south_slavic_row3_1", + "keyspec_south_slavic_row3_8", + "label_search_key", + "morekeys_h", + "keyspec_south_slavic_row1_6", + "morekeys_misc_g", + "label_next_key", "keyspec_south_slavic_row2_11", + "morekeys_k", + "morekeys_east_slavic_row2_2", + "label_done_key", + "label_go_key", "morekeys_tablet_punctuation", - "morekeys_j", - "keyspec_y", - "morekeys_cyrillic_ka", - "morekeys_currency_dollar", - "morekeys_east_slavic_row2_11", - "morekeys_cyrillic_a", - "keyspec_q", - "morekeys_exclamation", + "morekeys_misc_l", + "morekeys_misc_r", + "label_pause_key", + "morekeys_cyrillic_o", + "label_send_key", + "label_previous_key", "morekeys_misc_h", - "morekeys_greater_than", + "morekeys_less_than", + "keyspec_y", + "keyspec_w", + "morekeys_currency_dollar", + "morekeys_j", + "morekeys_plus", + "morekeys_east_slavic_row2_11", + "keyspec_x", + "keyspec_q", + "morekeys_cyrillic_a", + "morekeys_cyrillic_ka", "morekeys_misc_t", "morekeys_w", - "keyspec_w", - "keyspec_x", - "morekeys_less_than", - "morekeys_plus", - "double_rqm_9qm", - "actions_z", - "actions_c", - "actions_m", - "morekeys_f", - "qwertysyms_f", - "morekeys_symbols_0", - "morekeys_symbols_7", - "qwertysyms_b", - "actions_7", - "morekeys_currency_generic", - "qwertysyms_e", - "morekeys_misc_p", - "morekeys_symbols_2", - "morekeys_misc_m", - "morekeys_single_quote", - "qwertysyms_h", - "qwertysyms_l", - "morekeys_q", - "actions_2", - "actions_b", - "qwertysyms_r", - "qwertysyms_k", - "number_2", - "actions_r", - "actions_t", - "single_9qm_lqm", - "actions_3", - "actions_u", - "actions_0", - "qwertysyms_z", - "qwertysyms_u", - "actions_g", - "single_9qm_rqm", - "number_8", - "morekeys_misc_d", - "qwertysyms_n", - "number_9", - "qwertysyms_0", - "actions_s", - "qwertysyms_y", - "morekeys_symbols_1", - "double_9qm_lqm", - "actions_d", - "keylabel_to_phone_symbols", - "qwertysyms_6", - "qwertysyms_a", - "morekeys_misc_x", - "morekeys_am_pm", - "actions_o", - "qwertysyms_m", - "actions_y", - "number_6", - "qwertysyms_1", - "number_7", - "qwertysyms_p", - "keyspec_action_previous", - "qwertysyms_j", - "single_raqm_laqm", - "actions_i", + "morekeys_greater_than", + "morekeys_exclamation", "number_1", - "morekeys_misc_j", - "morekeys_misc_w", - "double_raqm_laqm", - "morekeys_popular_domain", - "single_laqm_raqm", - "qwertysyms_o", - "number_0", - "keyspecs_right_parenthesis_more_keys", - "morekeys_p", - "actions_8", - "qwertysyms_3", - "actions_f", - "qwertysyms_x", - "qwertysyms_q", - "keylabel_to_phone_numeric", - "qwertysyms_w", - "double_lqm_rqm", - "keyspec_emoji_action_key_navigation", - "morekeys_misc_k", - "keyspec_shortcut", - "actions_v", - "morekeys_symbols_9", - "morekeys_symbols_8", - "morekeys_misc_b", "qwertysyms_s", - "actions_4", - "qwertysyms_d", - "morekeys_m", - "morekeys_x", - "morekeys_misc_q", - "morekeys_bottomrow_comma", - "number_5", - "actions_k", - "keylabel_to_more_symbol", - "qwertysyms_t", - "qwertysyms_c", - "actions_h", - "morekeys_symbols_6", - "morekeys_b", - "number_4", - "morekeys_symbols_4", - "actions_x", - "qwertysyms_7", - "double_laqm_raqm", - "morekeys_misc_v", - "qwertysyms_5", - "actions_1", - "keyspecs_left_parenthesis_more_keys", - "keyspec_action_next", - "actions_9", - "actions_e", - "number_3", - "morekeys_tablet_double_quote", - "morekeys_double_quote", - "actions_a", - "qwertysyms_g", - "qwertysyms_v", - "keyspec_settings", - "qwertysyms_4", - "keylabel_time_am", - "actions_q", - "actions_5", - "single_lqm_rqm", - "actions_6", - "keyspec_emoji_action_key", - "morekeys_misc_f", - "keylabel_tablet_to_more_symbol", - "keylabel_time_pm", - "actions_p", - "morekeys_v", - "qwertysyms_2", - "qwertysyms_9", - "morekeys_symbols_3", - "actions_l", + "morekeys_p", + "actions_2", + "morekeys_f", + "morekeys_misc_j", "actions_w", - "morekeys_symbols_5", + "morekeys_symbols_6", + "qwertysyms_c", + "qwertysyms_4", + "qwertysyms_u", + "qwertysyms_g", + "morekeys_am_pm", + "morekeys_x", + "qwertysyms_w", + "morekeys_misc_k", + "actions_8", + "morekeys_misc_f", + "qwertysyms_a", + "actions_k", + "actions_o", + "actions_d", + "number_7", + "morekeys_misc_v", + "morekeys_misc_q", + "morekeys_misc_d", + "single_9qm_rqm", + "qwertysyms_h", + "actions_9", "double_9qm_rqm", - "actions_n", - "keyspec_popular_domain", + "actions_a", + "actions_i", + "morekeys_double_quote", + "number_9", + "actions_e", + "number_0", "actions_j", + "morekeys_currency_generic", + "actions_7", + "actions_z", + "qwertysyms_j", + "morekeys_v", + "qwertysyms_i", + "keylabel_to_phone_symbols", + "keyspec_emoji_action_key_navigation", + "qwertysyms_n", + "keyspecs_right_parenthesis_more_keys", + "qwertysyms_1", + "actions_u", + "actions_n", + "qwertysyms_d", + "morekeys_symbols_2", + "morekeys_symbols_5", + "morekeys_symbols_9", + "morekeys_misc_m", + "qwertysyms_f", + "single_9qm_lqm", + "qwertysyms_q", + "actions_l", + "actions_6", + "double_9qm_lqm", + "keylabel_tablet_to_more_symbol", + "qwertysyms_2", + "morekeys_symbols_7", + "qwertysyms_x", + "morekeys_m", + "morekeys_misc_p", + "morekeys_single_quote", + "actions_4", + "number_4", + "actions_y", + "double_lqm_rqm", + "qwertysyms_9", + "morekeys_misc_w", + "morekeys_symbols_0", + "double_raqm_laqm", + "actions_m", + "morekeys_misc_x", + "qwertysyms_3", + "actions_1", + "actions_r", + "qwertysyms_0", + "number_3", + "actions_s", + "morekeys_symbols_8", + "actions_t", + "morekeys_q", + "actions_c", + "qwertysyms_e", + "actions_b", + "actions_h", + "number_5", "single_rqm_9qm", + "keyspecs_left_parenthesis_more_keys", + "keylabel_time_pm", + "qwertysyms_l", + "morekeys_symbols_4", + "morekeys_bottomrow_comma", + "qwertysyms_t", + "actions_f", + "keyspec_settings", "qwertysyms_8", - "qwertysyms_i" + "actions_5", + "double_rqm_9qm", + "keylabel_to_phone_numeric", + "qwertysyms_r", + "qwertysyms_y", + "qwertysyms_z", + "keyspec_action_next", + "qwertysyms_b", + "keylabel_time_am", + "number_6", + "actions_v", + "actions_q", + "number_8", + "single_raqm_laqm", + "morekeys_symbols_3", + "number_2", + "morekeys_popular_domain", + "qwertysyms_7", + "qwertysyms_k", + "keyspec_emoji_action_key", + "actions_x", + "qwertysyms_6", + "qwertysyms_p", + "qwertysyms_v", + "actions_g", + "single_lqm_rqm", + "keyspec_popular_domain", + "keyspec_shortcut", + "actions_p", + "qwertysyms_5", + "qwertysyms_o", + "actions_0", + "morekeys_symbols_1", + "double_laqm_raqm", + "morekeys_misc_b", + "morekeys_tablet_double_quote", + "keylabel_to_more_symbol", + "morekeys_b", + "qwertysyms_m", + "single_laqm_raqm", + "actions_3", + "keyspec_action_previous" }; private static final String EMPTY = ""; @@ -385,8 +385,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f6,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e2,\u00e4,\u00e0,\u00e6,\u00e3,\u00e5,\u0101", + "\u00f6,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00fc,\u00f9,\u016b", "\u0119,\u0117,\u0113", null, @@ -420,87 +420,86 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u0661", - "\u0660", - "5", - "\u0664", - "\u0666", "2", - "9", - null, - "1", + "8", "\u0663", - "\u0667", - "\u0668", - "\u0662", - "\u0669", "\u0665", - "0,\u066b,\u066c", - "4", - "6", null, + "\u0669", + "\u0668", + "4", + "\u0660", + "\u0666", + "\u0664", + "\u0662", + "\u0667", + null, + "\u0661", + null, + "6", + "5", + "0,\u066b,\u066c", + "9", + "7", + "1", "!text/morekeys_arabic_diacritics", + null, "\u0663\u0662\u0661\u061f", null, null, null, null, - null, - null, - null, "!text/morekeys_arabic_diacritics", null, null, null, - null, - null, - null, "\u060c", - "\u203a|\u2039", + null, + null, + null, + null, + null, + "<|>", + null, + null, + "\u00bb|\u00ab", + "\u2264|\u2265", + null, + "{|}", + "\u060c", + "?,\u00bf", + "\u00ab|\u00bb", "(|)", - "\u0651", null, ">|<", "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,\\\",\\'", - "\u2264|\u2265", - ")|(", - "<|>", - "[|]", - "\u060c", "]|[", - "}|{", - "\u00bb|\u00ab", - null, - null, - "?,\u00bf", "\u2605,\u066d", - null, - "\u00ab|\u00bb", - null, "\u2039|\u203a", - "{|}", + null, + ")|(", "\u2265|\u2264", - "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", + "[|]", + "\u0651", + "\u203a|\u2039", + "}|{", + "\u0651", + null, null, - "\u061f", "\\%,\u2030", - null, "\u266a", - ";", - null, + "\u066a", "\u061f", "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", + "\u061f", + ";", null, - null, - "\u066a", - null, - "\u0651", "\u061b", null, - "!fixedColumnOrder!8, \u0654\u25cc|\u0654, \u0652\u25cc|\u0652, \u064d\u25cc|\u064d, \u064c\u25cc|\u064c, \u0651\u25cc|\u0651, \u064b\u25cc|\u064b,!text/keyspec_symbols_question,!, \u0656\u25cc|\u0656, \u0670\u25cc|\u0670, \u0653\u25cc|\u0653, \u0650\u25cc|\u0650, \u064f\u25cc|\u064f,\u0640, \u0655\u25cc|\u0655, \u064e\u25cc|\u064e" + "!fixedColumnOrder!8, \u0654\u25cc|\u0654, \u0652\u25cc|\u0652, \u064d\u25cc|\u064d, \u064c\u25cc|\u064c, \u0651\u25cc|\u0651, \u064b\u25cc|\u064b,!text/keyspec_symbols_question,!, \u0656\u25cc|\u0656, \u0670\u25cc|\u0670, \u0653\u25cc|\u0653, \u0650\u25cc|\u0650, \u064f\u25cc|\u064f,\u0640, \u0655\u25cc|\u0655, \u064e\u25cc|\u064e", + null, + null, + "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys" }; private static final String[] TEXTS_az = { @@ -520,8 +519,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u017e", "\u0148,\u00f1", + "\u017e", null, null, null, @@ -542,14 +541,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, "\u011f" }; @@ -602,16 +593,19 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u0451", null, - "\u044a", - "\u044d", + "\u0456", + null, "\u044b", null, null, null, - "\u0456", + null, + "\u044d", + null, + null, + "\u044a", "\u045e" }; @@ -652,27 +646,28 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u09e7", - "\u09e6", - "5", - "\u09ea", - "\u09ec", "2", - "9", - null, - "1", + "8", "\u09e9", - "\u09ed", - "\u09ee", - "\u09e8", - "\u09ef", "\u09eb", - "0", + null, + "\u09ef", + "\u09ee", "4", - "6" + "\u09e6", + "\u09ec", + "\u09ea", + "\u09e8", + "\u09ed", + null, + "\u09e7", + null, + "6", + "5", + "0", + "9", + "7", + "1" }; private static final String[] TEXTS_bn_IN = { @@ -702,13 +697,14 @@ public final class KeyboardTextsTable { "\u00e7", null, null, - "\u00f6,\u00f4,\u00f5,\u00f8,\u0153,\u014d,\u00ba", "\u00e1,\u00e4,\u00e2,\u00e3,\u00e5,\u0105,\u00e6,\u0101,\u00aa", + "\u00f6,\u00f4,\u00f5,\u00f8,\u0153,\u014d,\u00ba", "\u00f9,\u00fb,\u016b", "\u00eb,\u00ea,\u0119,\u0117,\u0113", null, null, "\u00ec,\u00ee,\u012f,\u012b", + null, "\u0107,\u010d", null, null, @@ -758,20 +754,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "!autoColumnOrder!9,\\\\,?,!,\u00b7,#,),(,/,;,',@,:,-,\\\",+,\\%,&", null, null, @@ -791,6 +773,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u00e7", null, null, @@ -820,6 +803,12 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, "!autoColumnOrder!8,\\\\,',\u00b7,#,),(,/,;,@,:,-,\\\",+,\\%,&" }; @@ -849,87 +838,86 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u0661", - "\u0660", - "5", - "\u0664", - "\u0666", "2", - "9", - null, - "1", + "8", "\u0663", - "\u0667", - "\u0668", - "\u0662", - "\u0669", "\u0665", - "0,\u066b,\u066c", - "4", - "6", null, + "\u0669", + "\u0668", + "4", + "\u0660", + "\u0666", + "\u0664", + "\u0662", + "\u0667", + null, + "\u0661", + null, + "6", + "5", + "0,\u066b,\u066c", + "9", + "7", + "1", "\u061f", + null, "\u0663\u0662\u0661\u061f", null, null, null, null, - null, - null, - null, "\u061f", null, null, null, + "\u060c", + null, null, null, ".", + null, + "<|>", + null, + null, + "\u00bb|\u00ab", + "\u2264|\u2265", + null, + "{|}", "\u060c", - "\u203a|\u2039", + "?,\u00bf", + "\u00ab|\u00bb", "(|)", - "\u0651", null, ">|<", "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,\\\",\\'", - "\u2264|\u2265", - ")|(", - "<|>", - "[|]", - "\u060c", "]|[", - "}|{", - "\u00bb|\u00ab", - null, - null, - "?,\u00bf", "\u2605,\u066d", - null, - "\u00ab|\u00bb", - null, "\u2039|\u203a", - "{|}", + null, + ")|(", "\u2265|\u2264", - "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", + "[|]", + "\u0651", + "\u203a|\u2039", + "}|{", + "\u0651", + null, null, - "\u061f", "\\%,\u2030", - null, "\u266a", - ";", - null, + "\u066a", "\u061f", "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", + "\u061f", + ";", null, - null, - "\u066a", - null, - "\u0651", "\u061b", null, - "!fixedColumnOrder!7, \u0655\u25cc|\u0655, \u0654\u25cc|\u0654, \u0652\u25cc|\u0652, \u064d\u25cc|\u064d, \u064c\u25cc|\u064c, \u064b\u25cc|\u064b, \u0651\u25cc|\u0651, \u0656\u25cc|\u0656, \u0670\u25cc|\u0670, \u0653\u25cc|\u0653, \u0650\u25cc|\u0650, \u064f\u25cc|\u064f, \u064e\u25cc|\u064e,\u0640|\u0640" + "!fixedColumnOrder!7, \u0655\u25cc|\u0655, \u0654\u25cc|\u0654, \u0652\u25cc|\u0652, \u064d\u25cc|\u064d, \u064c\u25cc|\u064c, \u064b\u25cc|\u064b, \u0651\u25cc|\u0651, \u0656\u25cc|\u0656, \u0670\u25cc|\u0670, \u0653\u25cc|\u0653, \u0650\u25cc|\u0650, \u064f\u25cc|\u064f, \u064e\u25cc|\u064e,\u0640|\u0640", + null, + null, + "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys" }; private static final String[] TEXTS_cs = { @@ -945,20 +933,23 @@ public final class KeyboardTextsTable { "\u010d", null, "\u0161", - "\u00f6,\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e0,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", + "\u00f6,\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00fb,\u00fc,\u00f9,\u016b", "\u00e8,\u00ea,\u00eb,\u0119,\u0117,\u0113", - "\u017e", "\u0148", + "\u017e", "\u00ee,\u00ef,\u00ec,\u012f,\u012b", - "\u00e7,\u0107", "\u00df,\u015b", - "!text/single_raqm_laqm", + "\u00e7,\u0107", "!text/double_raqm_laqm", + "!text/single_raqm_laqm", "\u00fd", null, null, + null, + null, + null, "\u010f", null, null, @@ -968,6 +959,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u017a,\u017c", null, null, @@ -981,18 +974,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u00f1,\u0144", "\u0165", null, null, @@ -1003,12 +984,7 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, + "\u00f1,\u0144", null, null, "\u0159", @@ -1032,6 +1008,9 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, "\u00ff" }; @@ -1048,8 +1027,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f6,\u00f3,\u00f4,\u00f2,\u00f5,\u0153,\u014d", "\u00e1,\u00e4,\u00e0,\u00e2,\u00e3,\u0101", + "\u00f6,\u00f3,\u00f4,\u00f2,\u00f5,\u0153,\u014d", null, null, null, @@ -1057,8 +1036,8 @@ public final class KeyboardTextsTable { null, null, null, - "!text/single_raqm_laqm", "!text/double_raqm_laqm", + "!text/single_raqm_laqm", null, null, null, @@ -1086,15 +1065,13 @@ public final class KeyboardTextsTable { null, null, null, - "\u00e6", - null, - null, null, "\u00e5", + null, + null, + null, "\u00f8", - null, - null, - null, + "\u00e6", null, null, "\u00e4", @@ -1113,8 +1090,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, "\u00f6" }; @@ -1131,17 +1106,24 @@ public final class KeyboardTextsTable { null, null, "\u00df", - "%,\u00f4,\u00f2,\u00f3,\u00f5,\u0153,\u00f8,\u014d", "%,\u00e2,\u00e0,\u00e1,\u00e6,\u00e3,\u00e5,\u0101", + "%,\u00f4,\u00f2,\u00f3,\u00f5,\u0153,\u00f8,\u014d", "%,\u00fb,\u00f9,\u00fa,\u016b", null, null, null, null, - null, "\u015b,\u0161", - "!text/single_raqm_laqm", + null, "!text/double_raqm_laqm", + "!text/single_raqm_laqm", + null, + null, + null, + null, + null, + null, + null, null, null, null, @@ -1208,24 +1190,17 @@ public final class KeyboardTextsTable { null, null, null, - "\u00e8", null, null, "\u00fc", null, - null, - "\u00e4", - null, - null, - "\u00e0", - null, - null, - null, - null, + "\u00e9", null, "\u00f6", + "\u00e4", null, - "\u00e9" + "\u00e8", + "\u00e0" }; private static final String[] TEXTS_el = { @@ -1257,16 +1232,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u0107,\u010d,\u00e7,\u010b", "\u00df,\u0161,\u015b,\u0219,\u015f", - null, - null, - null, - null, - null, - null, - null, - null, + "\u0107,\u010d,\u00e7,\u010b", null, null, null, @@ -1335,29 +1302,34 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, "\u0135", null, null, null, null, null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u0125", null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u011f,\u0121,\u0123", null, null, @@ -1370,19 +1342,18 @@ public final class KeyboardTextsTable { null, null, null, - "\u016d", null, null, - null, - null, - "\u015d", - null, "\u0127", null, - null, - null, + "\u016d", "\u011d", - "\u0109" + null, + null, + null, + null, + "\u0109", + "\u015d" }; private static final String[] TEXTS_es = { @@ -1398,12 +1369,12 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f2,\u00f6,\u00f4,\u00f5,\u00f8,\u0153,\u014d,\u00ba", "\u00e0,\u00e4,\u00e2,\u00e3,\u00e5,\u0105,\u00e6,\u0101,\u00aa", + "\u00f2,\u00f6,\u00f4,\u00f5,\u00f8,\u0153,\u014d,\u00ba", "\u00f9,\u00fb,\u016b", "\u00e8,\u00eb,\u00ea,\u0119,\u0117,\u0113", - null, "\u00f1", + null, "\u00ef,\u00ec,\u00ee,\u012f,\u012b", null, null, @@ -1445,29 +1416,16 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, "\u0144", null, null, null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "!autoColumnOrder!9,\\\\,?,!,#,),(,/,;,\u00a1,',@,:,-,\\\",+,\\%,&,\u00bf" }; @@ -1484,14 +1442,13 @@ public final class KeyboardTextsTable { null, null, "\u0161", - "\u00f2,\u00f3,\u00f4,\u0153,\u0151,\u00f8", "\u0101,\u00e0,\u00e1,\u00e2,\u00e3,\u00e5,\u00e6,\u0105", + "\u00f2,\u00f3,\u00f4,\u0153,\u0151,\u00f8", "\u016b,\u0173,\u00f9,\u00fa,\u00fb,\u016f,\u0171", null, + null, "\u017e", null, - null, - null, "\u00df,\u015b,\u015f", null, null, @@ -1507,6 +1464,12 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, "\u017c,\u017a", null, null, @@ -1518,19 +1481,12 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - "\u00f6", - null, - null, - null, "\u00fc", + null, + null, + null, "\u00e4", - null, - null, - null, + "\u00f6", null, null, "\u00f5" @@ -1553,7 +1509,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1,\u0144" }; @@ -1583,89 +1538,86 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u06f1", - "\u06f0", - "5", - "\u06f4", - "\u06f6", "2", - "9", - null, - "1", + "8", "\u06f3", - "\u06f7", - "\u06f8", - "\u06f2", - "\u06f9", "\u06f5", - "0,\u066b,\u066c", - "4", - "6", null, + "\u06f9", + "\u06f8", + "4", + "\u06f0", + "\u06f6", + "\u06f4", + "\u06f2", + "\u06f7", + null, + "\u06f1", + null, + "6", + "5", + "0,\u066b,\u066c", + "9", + "7", + "1", "!text/morekeys_arabic_diacritics", + null, "\u06f3\u06f2\u06f1\u061f", null, null, null, null, - null, - null, - null, "!text/morekeys_arabic_diacritics", null, null, null, - null, - null, - null, "\u060c", - "\u203a|\u2039", + null, + null, + null, + null, + null, + "<|>", + null, + null, + "\u00bb|\u00ab", + "\u2264|\u2265", + null, + "{|}", + "\u060c", + "?,\u00bf", + "\u00ab|\u00bb", "(|)", - "\u064b", null, ">|<", "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", - "\u2264|\u2265", - ")|(", - "<|>", - "[|]", - "\u060c", "]|[", - "}|{", - "\u00bb|\u00ab", - null, - null, - "?,\u00bf", "\u2605,\u066d", - null, - "\u00ab|\u00bb", - null, "\u2039|\u203a", - "{|}", + null, + ")|(", "\u2265|\u2264", - "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", + "[|]", + "\u064b", + "\u203a|\u2039", + "}|{", + "\u064b", + null, null, - "\u061f", "\\%,\u2030", - null, "\u266a", - ";", - null, + "\u066a", "\u061f", "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", + "\u061f", + ";", null, - null, - "\u066a", - null, - "\u064b", "\u061b", null, "!fixedColumnOrder!8, \u0654\u25cc|\u0654, \u0652\u25cc|\u0652, \u064d\u25cc|\u064d, \u064c\u25cc|\u064c, \u0651\u25cc|\u0651, \u064b\u25cc|\u064b,!text/keyspec_symbols_question,!, \u0656\u25cc|\u0656, \u0670\u25cc|\u0670, \u0653\u25cc|\u0653, \u0650\u25cc|\u0650, \u064f\u25cc|\u064f,\u0640, \u0655\u25cc|\u0655, \u064e\u25cc|\u064e", null, null, + "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", null, null, null, @@ -1693,17 +1645,20 @@ public final class KeyboardTextsTable { null, null, null, + "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than", null, null, null, null, null, - "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than", null, null, null, null, - "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than" + null, + null, + null, + "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than" }; private static final String[] TEXTS_fi = { @@ -1719,14 +1674,13 @@ public final class KeyboardTextsTable { null, null, "\u0161", - "\u00f8,\u00f4,\u00f2,\u00f3,\u00f5,\u0153,\u014d", "\u00e6,\u00e0,\u00e1,\u00e2,\u00e3,\u0101", + "\u00f8,\u00f4,\u00f2,\u00f3,\u00f5,\u0153,\u014d", + null, null, null, "\u017e", null, - null, - null, "\u00df,\u015b", null, null, @@ -1742,6 +1696,12 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, "\u017a,\u017c", null, null, @@ -1753,21 +1713,14 @@ public final class KeyboardTextsTable { null, null, null, + "\u00e5", null, null, null, - null, + "\u00e4", "\u00f6", null, null, - null, - "\u00e5", - "\u00e4", - null, - null, - null, - null, - null, "\u00f8", null, null, @@ -1784,8 +1737,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, "\u00e6" }; @@ -1802,15 +1753,15 @@ public final class KeyboardTextsTable { "\u00e7", null, null, - "%,\u00f6,\u00f2,\u00f3,\u00f5,\u00f8,\u014d,\u00ba", "\u00e1,\u00e4,\u00e3,\u00e5,\u0101,\u00aa", + "%,\u00f6,\u00f2,\u00f3,\u00f5,\u00f8,\u014d,\u00ba", "\u00fa,\u016b", "%,\u0119,\u0117,\u0113", null, null, "\u00ec,\u00ed,\u012f,\u012b", - "%,\u0107,\u010d", null, + "%,\u0107,\u010d", null, null, "%,\u00ff", @@ -1879,24 +1830,24 @@ public final class KeyboardTextsTable { null, null, null, - "\u00fc", + null, + null, + null, + null, + null, + null, + null, null, null, "\u00e8", null, - null, - "\u00e0", - null, - null, - "\u00e4", - null, - null, - null, - null, + "\u00f6", null, "\u00e9", + "\u00e0", null, - "\u00f6" + "\u00fc", + "\u00e4" }; private static final String[] TEXTS_gl = { @@ -1916,7 +1867,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1,\u0144" }; @@ -1946,48 +1896,62 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u0967", - "\u0966", - "5", - "\u096a", - "\u096c", "2", - "9", - null, - "1", + "8", "\u0969", - "\u096d", - "\u096e", - "\u0968", - "\u096f", "\u096b", - "0", + null, + "\u096f", + "\u096e", "4", + "\u0966", + "\u096c", + "\u096a", + "\u0968", + "\u096d", + null, + "\u0967", + null, "6", - null, + "5", + "0", + "9", + "7", + "1", "!autoColumnOrder!8,\\\\,.,',#,),(,/,;,@,:,-,\\\",+,\\%,&", + null, "?\u0967\u0968\u0969", null, null, null, null, - null, - null, - null, "!autoColumnOrder!9,\\\\,.,?,!,#,),(,/,;,',@,:,-,\\\",+,\\%,&", null, null, null, null, null, + null, + null, "\u0964", null, null, null, null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u0964" }; @@ -2100,25 +2064,29 @@ public final class KeyboardTextsTable { null, null, null, - null, "Wait", null, null, - "Done", null, null, - "Prev", null, - "Send", + "Search", + null, + null, + null, "Next", null, null, null, + "Done", "Go", null, null, - "Search", - "Pause" + null, + "Pause", + null, + "Send", + "Prev" }; private static final String[] TEXTS_hr = { @@ -2138,13 +2106,16 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u017e", null, - null, - "\u00e7", "\u015b,\u00df", - "!text/single_raqm_laqm", + "\u00e7", "!text/double_raqm_laqm", + "!text/single_raqm_laqm", + null, + null, + null, null, null, null, @@ -2157,6 +2128,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u017a,\u017c" }; @@ -2173,8 +2146,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e0,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", + "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00fb,\u00f9,\u016b", "\u00e8,\u00ea,\u00eb,\u0119,\u0117,\u0113", null, @@ -2182,8 +2155,8 @@ public final class KeyboardTextsTable { "\u00ee,\u00ef,\u00ec,\u012f,\u012b", null, null, - "!text/single_raqm_laqm", - "!text/double_raqm_laqm" + "!text/double_raqm_laqm", + "!text/single_raqm_laqm" }; private static final String[] TEXTS_hy = { @@ -2245,11 +2218,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - "\u0589", "\u055d", null, null, @@ -2261,16 +2229,29 @@ public final class KeyboardTextsTable { null, null, null, - "\u055d", - null, - null, - null, - null, - null, - "\u055e,\u00bf", - null, "!autoColumnOrder!8,\\,,\u055e,\u055c,.,\u055a,\u0559,?,!,\u055d,\u055b,\u058a,\u00bb,\u00ab,\u055f,;,:", null, + "\u055d", + "\u055e,\u00bf", + null, + null, + null, + null, + null, + null, + null, + null, + "\u0589", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, null, null, null, @@ -2341,8 +2322,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e5,\u00e0,\u00e2,\u00e3,\u0101", + "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00fc,\u00fb,\u00f9,\u016b", "\u00eb,\u00e8,\u00ea,\u0119,\u0117,\u0113", null, @@ -2355,6 +2336,9 @@ public final class KeyboardTextsTable { "\u00fd", null, null, + null, + null, + null, "\u00f0", null, null, @@ -2379,16 +2363,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u00fe", null, null, @@ -2426,8 +2400,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, "\u00ff" }; @@ -2444,8 +2416,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f3,\u00f4,\u00f6,\u00f5,\u0153,\u00f8,\u014d,\u00ba", "\u00e1,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101,\u00aa", + "\u00f3,\u00f4,\u00f6,\u00f5,\u0153,\u00f8,\u014d,\u00ba", "\u00fa,\u00fb,\u00fc,\u016b", "\u00ea,\u00eb,\u0119,\u0117,\u0113", null, @@ -2521,24 +2493,24 @@ public final class KeyboardTextsTable { null, null, null, - "\u00e8", + null, + null, + null, + null, + null, + null, + null, null, null, "\u00fc", null, - null, - "\u00e4", - null, - null, - "\u00e0", - null, - null, - null, - null, + "\u00e9", null, "\u00f6", + "\u00e4", null, - "\u00e9" + "\u00e8", + "\u00e0" }; private static final String[] TEXTS_iw = { @@ -2606,39 +2578,30 @@ public final class KeyboardTextsTable { null, null, null, - "\u203a|\u2039", - "(|)", + "<|>", null, null, + "\u00bb|\u00ab", + "\u2264|\u2265", + null, + "{|}", + null, + null, + "\u00ab|\u00bb", + "(|)", + null, ">|<", null, - "\u2264|\u2265", + "]|[", + "\u2605", + "\u2039|\u203a", + null, ")|(", - "<|>", + "\u2265|\u2264", "[|]", null, - "]|[", + "\u203a|\u2039", "}|{", - "\u00bb|\u00ab", - null, - null, - null, - "\u2605", - null, - "\u00ab|\u00bb", - null, - "\u2039|\u203a", - "{|}", - "\u2265|\u2264", - null, - null, - null, - null, - null, - null, - null, - null, - null, null, null, null, @@ -2752,16 +2715,19 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u0451", null, - "\u044a", - "\u044d", + "\u0438", + null, "\u044b", null, null, null, - "\u0438", + null, + "\u044d", + null, + null, + "\u044a", "\u0449", null, null, @@ -2810,12 +2776,9 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, + "\u0493", "\u04a3", + "\u04af,\u04b1", null, null, null, @@ -2825,22 +2788,28 @@ public final class KeyboardTextsTable { null, null, null, + "\u0456", + null, + null, + null, + null, + null, + null, "\u04e9", null, - "\u0456", - "\u04af,\u04b1", - null, - null, - null, - "\u0493", null, null, null, null, - "\u049b", + null, + null, + null, null, "\u04bb", - "\u04d9" + null, + null, + "\u04d9", + "\u049b" }; private static final String[] TEXTS_km = { @@ -2978,6 +2947,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u17db,\u00a2,\u00a3,\u20ac,\u00a5,\u20b1" }; @@ -3044,16 +3014,19 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u0451", null, - "\u044a", - "\u044d", + "\u0438", + null, "\u044b", null, null, null, - "\u0438", + null, + "\u044d", + null, + null, + "\u044a", "\u0449", null, null, @@ -3103,11 +3076,8 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, "\u04a3", + "\u04af", null, null, null, @@ -3117,10 +3087,14 @@ public final class KeyboardTextsTable { null, null, null, - "\u04e9", null, null, - "\u04af" + null, + null, + null, + null, + null, + "\u04e9" }; private static final String[] TEXTS_lo = { @@ -3154,6 +3128,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u017e" }; @@ -3170,15 +3145,15 @@ public final class KeyboardTextsTable { "\u010d", null, "\u0161", - "\u00f2,\u00f3,\u00f4,\u00f5,\u00f6,\u0153,\u0151,\u00f8", "\u00e0,\u00e1,\u00e2,\u00e3,\u00e4,\u00e5,\u00e6,\u0105", + "\u00f2,\u00f3,\u00f4,\u00f5,\u00f6,\u0153,\u0151,\u00f8", "\u0173,\u00f9,\u00fa,\u00fb,\u00fc,\u016f,\u0171", "\u0117,\u00e8,\u00e9,\u00ea,\u00eb,\u0119,\u011b", - "\u017e", "\u0146", + "\u017e", "\u012f,\u00ec,\u00ed,\u00ee,\u00ef,\u0131", - "\u00e7,\u0107", "\u00df,\u015b,\u015f", + "\u00e7,\u0107", null, null, null, @@ -3193,6 +3168,11 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + "\u0123", + null, "\u017c,\u017a", null, null, @@ -3204,7 +3184,6 @@ public final class KeyboardTextsTable { null, null, null, - "\u0123", null, null, null, @@ -3219,30 +3198,13 @@ public final class KeyboardTextsTable { null, "\u00f1,\u0144", null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, + "\u013c", "\u0157", null, null, null, null, null, - "\u013c", null, null, null, @@ -3266,19 +3228,38 @@ 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, + "\u011f", + null, + null, "\u0137", null, null, null, null, - null, - null, - null, "\u0142,\u013a,\u013e", - null, - null, - "\u0159,\u0155", - "\u011f" + "\u0159,\u0155" }; private static final String[] TEXTS_mk = { @@ -3330,7 +3311,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u0450", null, null, @@ -3390,26 +3370,17 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - "\u0455", - null, - null, "\u045d", - "\u0453", - null, - null, - null, - null, - null, - null, - null, - null, null, null, null, null, "\u0437", + "\u0453", + null, + null, + "\u0455", + null, null, "\u045c" }; @@ -3468,27 +3439,28 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u0967", - "\u0966", - "5", - "\u096a", - "\u096c", "2", - "9", - null, - "1", + "8", "\u0969", - "\u096d", - "\u096e", - "\u0968", - "\u096f", "\u096b", - "0", + null, + "\u096f", + "\u096e", "4", + "\u0966", + "\u096c", + "\u096a", + "\u0968", + "\u096d", + null, + "\u0967", + null, "6", + "5", + "0", + "9", + "7", + "1", null, null, "?\u0967\u0968\u0969" @@ -3553,24 +3525,11 @@ public final class KeyboardTextsTable { null, null, null, - null, + "\u104a", null, null, null, "\u104b", - "\u104a", - null, - null, - "\u104a", - "\u104b", - null, - "\\", - null, - null, - null, - null, - null, - null, null, null, null, @@ -3585,9 +3544,16 @@ public final class KeyboardTextsTable { null, null, null, + "\\", null, null, null, + "\u104b", + null, + null, + null, + "\u104a", + null, null, null, null, @@ -3679,17 +3645,15 @@ public final class KeyboardTextsTable { null, null, null, + null, + "\u00e5", + null, + null, + null, + "\u00e6", "\u00f8", null, null, - null, - "\u00e5", - "\u00e6", - null, - null, - null, - null, - null, "\u00f6", null, null, @@ -3706,8 +3670,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, "\u00e4" }; @@ -3737,48 +3699,62 @@ public final class KeyboardTextsTable { null, null, "3", - "8", - null, - "7", - "\u0967", - "\u0966", - "5", - "\u096a", - "\u096c", "2", - "9", - null, - "1", + "8", "\u0969", - "\u096d", - "\u096e", - "\u0968", - "\u096f", "\u096b", - "0", + null, + "\u096f", + "\u096e", "4", + "\u0966", + "\u096c", + "\u096a", + "\u0968", + "\u096d", + null, + "\u0967", + null, "6", - null, + "5", + "0", + "9", + "7", + "1", "!autoColumnOrder!8,.,\\\\,',#,),(,/,;,@,:,-,\\\",+,\\%,&", + null, "?\u0967\u0968\u0969", null, null, null, null, - null, - null, - null, "!autoColumnOrder!9,.,\\\\,?,!,#,),(,/,;,',@,:,-,\\\",+,\\%,&", null, null, null, null, null, + null, + null, "\u0964", null, null, null, null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u0964" }; @@ -3795,8 +3771,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e6,\u00e3,\u00e5,\u0101", + "\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00fb,\u00f9,\u016b", "\u0119,\u0117,\u0113" }; @@ -3814,15 +3790,20 @@ public final class KeyboardTextsTable { "\u0107", null, "\u015b", - "\u00f6,\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", "\u00e1,\u00e0,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", + "\u00f6,\u00f4,\u00f2,\u00f5,\u0153,\u00f8,\u014d", null, "\u00e8,\u00e9,\u00ea,\u00eb,\u0117,\u0113", - "\u017c,\u017a", "\u0144", + "\u017c,\u017a", null, - "\u00e7,\u010d", "\u00df,\u0161", + "\u00e7,\u010d", + null, + null, + null, + null, + null, null, null, null, @@ -3860,32 +3841,8 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1", null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0142" }; @@ -3902,13 +3859,14 @@ public final class KeyboardTextsTable { "\u00e7", null, null, - "\u00f2,\u00f6,\u0153,\u00f8,\u014d,\u00ba", "\u00e4,\u00e5,\u00e6,\u00aa", + "\u00f2,\u00f6,\u0153,\u00f8,\u014d,\u00ba", "\u00f9,\u00fb,\u016b", "\u00e8,\u0119,\u0117,\u0113,\u00eb", null, null, "\u00ee,\u00ec,\u00ef,\u012f,\u012b", + null, "\u010d,\u0107", null, null, @@ -3978,19 +3936,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u00e7" }; @@ -4014,14 +3959,13 @@ public final class KeyboardTextsTable { null, null, "\u0219", - null, "\u00e3,\u00e0,\u00e1,\u00e4,\u00e6,\u00e5,\u0101", null, null, null, null, + null, "\u00ef,\u00ec,\u00ed,\u012f,\u012b", - null, "\u00df,\u015b,\u0161", null, null, @@ -4056,12 +4000,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, "\u021b" }; @@ -4114,16 +4052,19 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u0451", null, - "\u044a", - "\u044d", + "\u0438", + null, "\u044b", null, null, null, - "\u0438", + null, + "\u044d", + null, + null, + "\u044a", "\u0449" }; @@ -4154,20 +4095,23 @@ public final class KeyboardTextsTable { "\u010d", null, "\u0161", - "\u00f6,\u00f2,\u00f5,\u0153,\u0151,\u00f8", "\u0101,\u00e0,\u00e2,\u00e3,\u00e5,\u00e6,\u0105", + "\u00f6,\u00f2,\u00f5,\u0153,\u0151,\u00f8", "\u016f,\u00fc,\u016b,\u0173,\u00f9,\u00fb,\u0171", "\u011b,\u0113,\u0117,\u00e8,\u00ea,\u00eb,\u0119", - "\u017e", "\u0148", + "\u017e", "\u012b,\u012f,\u00ec,\u00ee,\u00ef,\u0131", - "\u00e7,\u0107", "\u00df,\u015b,\u015f", - "!text/single_raqm_laqm", + "\u00e7,\u0107", "!text/double_raqm_laqm", + "!text/single_raqm_laqm", "\u00fd", null, null, + null, + null, + null, "\u010f", null, null, @@ -4177,6 +4121,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u017c,\u017a", null, null, @@ -4190,18 +4136,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u0146,\u00f1,\u0144", "\u0165", null, null, @@ -4212,21 +4146,19 @@ public final class KeyboardTextsTable { null, null, null, + "\u0146,\u00f1,\u0144", null, - null, - null, - null, - null, - null, - null, - null, + "\u013e,\u013a", "\u0155", null, null, null, null, null, - "\u013e,\u013a", + null, + null, + null, + null, null, null, null, @@ -4258,9 +4190,25 @@ 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, "\u013c,\u0142", - null, - null, "\u0159,\u0157", null, null, @@ -4278,11 +4226,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, "\u0163" }; @@ -4303,13 +4246,13 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u017e", null, null, "\u0107", - null, - "!text/single_raqm_laqm", - "!text/double_raqm_laqm" + "!text/double_raqm_laqm", + "!text/single_raqm_laqm" }; private static final String[] TEXTS_sr = { @@ -4334,9 +4277,8 @@ public final class KeyboardTextsTable { null, null, null, - "!text/single_raqm_laqm", "!text/double_raqm_laqm", - null, + "!text/single_raqm_laqm", null, null, null, @@ -4421,26 +4363,17 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - "\u0437", - null, - null, "\u045d", - "\u0452", - null, - null, - null, - null, - null, - null, - null, - null, null, null, null, null, "\u0455", + "\u0452", + null, + null, + "\u0437", + null, null, "\u045b" }; @@ -4462,6 +4395,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u017e,%", null, null, @@ -4472,6 +4406,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u0111,%", null, null, @@ -4551,28 +4487,29 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, "\u010cekaj", null, null, - "Gotov", null, null, - "Preth", null, - "\u0160alji", + "Tra\u017ei", + null, + null, + null, "Sled", null, null, null, + "Gotov", "Idi", null, null, - "Tra\u017ei", - "Pauza" + null, + "Pauza", + null, + "\u0160alji", + "Preth" }; private static final String[] TEXTS_sv = { @@ -4588,8 +4525,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f8,\u0153,\u00f3,\u00f2,\u00f4,\u00f5,\u014d", "\u00e6,\u00e1,\u00e0,\u00e2,\u0105,\u00e3", + "\u00f8,\u0153,\u00f3,\u00f2,\u00f4,\u00f5,\u014d", null, "\u00e8,\u00ea,\u00eb,\u0119", null, @@ -4597,8 +4534,8 @@ public final class KeyboardTextsTable { null, null, null, - "!text/single_raqm_laqm", "!text/double_raqm_laqm", + "!text/single_raqm_laqm", null, null, null, @@ -4626,15 +4563,13 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f6", - null, - null, null, "\u00e5", + null, + null, + null, "\u00e4", - null, - null, - null, + "\u00f6", null, null, "\u00f8,\u0153", @@ -4653,8 +4588,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, "\u00e6" }; @@ -4675,7 +4608,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1", null, null, @@ -4698,13 +4630,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, "g\\'" }; @@ -4786,7 +4711,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1,\u0144" }; @@ -4803,23 +4727,15 @@ public final class KeyboardTextsTable { "\u00e7", null, "\u015f", - "\u00f4,\u0153,\u00f2,\u00f3,\u00f5,\u00f8,\u014d", null, + "\u00f4,\u0153,\u00f2,\u00f3,\u00f5,\u00f8,\u014d", "\u00fb,\u00f9,\u00fa,\u016b", null, null, null, "\u00ee,\u00ef,\u00ec,\u00ed,\u012f,\u012b", - "\u0107,\u010d", "\u00df,\u015b,\u0161", - null, - null, - null, - null, - null, - null, - null, - null, + "\u0107,\u010d", null, null, null, @@ -4891,14 +4807,17 @@ public final class KeyboardTextsTable { null, null, null, + "\u0438", null, - "\u044a", - "\u0454", "\u0456", null, null, null, - "\u0438", + null, + "\u0454", + null, + null, + "\u044a", "\u0449", null, null, @@ -4947,6 +4866,7 @@ public final class KeyboardTextsTable { null, null, null, + "\u0491", null, null, null, @@ -4958,18 +4878,7 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - "\u0457", - null, - null, - null, - null, - "\u0491" + "\u0457" }; private static final String[] TEXTS_uz = { @@ -4989,8 +4898,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u017e", "\u0148,\u00f1", + "\u017e", null, null, null, @@ -5011,14 +4920,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, "\u011f" }; @@ -5049,6 +4950,9 @@ public final class KeyboardTextsTable { "\u1ef3,\u00fd,\u1ef7,\u1ef9,\u1ef5", null, null, + null, + null, + null, "\u0111" }; @@ -5069,7 +4973,6 @@ public final class KeyboardTextsTable { null, null, null, - null, "\u00f1" }; @@ -5090,8 +4993,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u017a,\u017c,\u017e", "\u00f1,\u0144,\u0146,\u0148,\u0149,\u014b", + "\u017a,\u017c,\u017e", null, null, null, @@ -5100,6 +5003,9 @@ public final class KeyboardTextsTable { "\u00fd,\u0177,\u00ff,\u0133", null, null, + null, + null, + null, "\u010f,\u0111,\u00f0", null, null, @@ -5109,17 +5015,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u011d,\u011f,\u0121,\u0123", null, null, @@ -5134,6 +5029,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u00fe,\u0163,\u0165,\u0167", null, null, @@ -5146,19 +5042,34 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, + "\u013a,\u013c,\u013e,\u0140,\u0142", "\u0155,\u0157,\u0159", null, null, null, null, null, - "\u013a,\u013c,\u013e,\u0140,\u0142", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, null, null, null, @@ -5182,6 +5093,10 @@ public final class KeyboardTextsTable { null, null, "\u0125", + null, + null, + null, + null, "\u0137,\u0138", null, null, @@ -5198,13 +5113,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, "\u0135", null, null, @@ -5213,9 +5121,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, "\u0175" }; @@ -5232,285 +5137,285 @@ public final class KeyboardTextsTable { EMPTY, "$", EMPTY, - "\u00f3,\u00f4,\u00f6,\u00f2,\u0153,\u00f8,\u014d,\u00f5", "\u00e0,\u00e1,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", + "\u00f3,\u00f4,\u00f6,\u00f2,\u0153,\u00f8,\u014d,\u00f5", "\u00fa,\u00fb,\u00fc,\u00f9,\u016b", "\u00e9,\u00e8,\u00ea,\u00eb,\u0113", EMPTY, EMPTY, "\u00ed,\u00ee,\u00ef,\u012b,\u00ec", - "\u00e7", "\u00df", - "!text/single_laqm_raqm", + "\u00e7", "!text/double_laqm_raqm", - EMPTY, - EMPTY, - EMPTY, - EMPTY, - EMPTY, - "1", - "0", - EMPTY, - "4", - "6", + "!text/single_laqm_raqm", EMPTY, EMPTY, EMPTY, EMPTY, "3", - "7", - "8", - "2", - "9", "5", EMPTY, + "9", + "8", + EMPTY, + "0", + "6", + "4", + "2", + "7", + EMPTY, + "1", + EMPTY, + EMPTY, + EMPTY, + EMPTY, EMPTY, EMPTY, EMPTY, "!text/morekeys_tablet_punctuation", + EMPTY, "?123", EMPTY, + "\u00e5", + EMPTY, + EMPTY, + "!text/morekeys_punctuation", + "\u00e4", "\u00f6", EMPTY, - EMPTY, - EMPTY, - "\u00e5", - "\u00e4", - "!text/morekeys_punctuation", - EMPTY, - EMPTY, - "\u00f1", - EMPTY, - "\u00f8", - ".", ",", - "\u203a", - "(", + "\u00f8", + EMPTY, EMPTY, ".", + "\u00f1", + "<", + EMPTY, + EMPTY, + "\u00bb", + "\u2264", + "!autoColumnOrder!8,\\,,?,!,#,!text/keyspec_right_parenthesis,!text/keyspec_left_parenthesis,/,;,',@,:,-,\",+,\\%,&", + "{", + ",", + "\u00bf", + "\u00ab", + "(", + "\u00e6", ">", EMPTY, - "\u2264", - ")", - "<", - "[", - ",", "]", - "}", - "\u00bb", - EMPTY, - "\u00e6", - "\u00bf", "\u2020,\u2021,\u2605", - "!autoColumnOrder!8,\\,,?,!,#,!text/keyspec_right_parenthesis,!text/keyspec_left_parenthesis,/,;,',@,:,-,\",+,\\%,&", - "\u00ab", - EMPTY, "\u2039", - "{", + ".", + ")", "\u2265", - "!autoColumnOrder!3,!text/keyspecs_left_parenthesis_more_keys", + "[", EMPTY, + "\u203a", + "}", + EMPTY, + "\u00f1", EMPTY, "\u2030", - EMPTY, "\u266a,\u2665,\u2660,\u2666,\u2663", - EMPTY, - EMPTY, - "?", - "!autoColumnOrder!3,!text/keyspecs_right_parenthesis_more_keys", - EMPTY, - EMPTY, "%", - "\u00f1", + EMPTY, + "!autoColumnOrder!3,!text/keyspecs_right_parenthesis_more_keys", + "?", + EMPTY, EMPTY, ";", EMPTY, EMPTY, EMPTY, EMPTY, + "!autoColumnOrder!3,!text/keyspecs_left_parenthesis_more_keys", + EMPTY, + EMPTY, EMPTY, "!string/label_wait_key", EMPTY, EMPTY, - "!string/label_done_key", EMPTY, EMPTY, - "!string/label_previous_key", EMPTY, - "!string/label_send_key", + "!string/label_search_key", + EMPTY, + EMPTY, + EMPTY, "!string/label_next_key", EMPTY, EMPTY, EMPTY, + "!string/label_done_key", "!string/label_go_key", - EMPTY, - EMPTY, - "!string/label_search_key", - "!string/label_pause_key", - EMPTY, - EMPTY, - EMPTY, "!autoColumnOrder!8,\\,,?,!,#,!text/keyspec_right_parenthesis,!text/keyspec_left_parenthesis,/,;,',@,:,-,\",+,\\%,&", EMPTY, - "y", EMPTY, + "!string/label_pause_key", + EMPTY, + "!string/label_send_key", + "!string/label_previous_key", + EMPTY, + "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_left_double_angle_quote", + "y", + "w", "\u00a2,\u00a3,\u20ac,\u00a5,\u20b1", EMPTY, + "\u00b1", EMPTY, + "x", "q", - "\u00a1,\u203d", + EMPTY, + EMPTY, + EMPTY, EMPTY, "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_right_double_angle_quote", - EMPTY, - EMPTY, - "w", - "x", - "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_left_double_angle_quote", - "\u00b1", - "\u201c,\u201d,\u201e", - "!icon/action_undo|!code/action_undo", - "!icon/action_copy|!code/action_copy", - EMPTY, - EMPTY, - "\\%", - "\u2070,\u2080,\u207f,\u2205", - "\u2077,\u2087,\u215e", - ";", - EMPTY, - "$,\u00a2,\u20ac,\u00a3,\u00a5,\u20b1", - "|", - EMPTY, - "\u00b2,\u2082,\u2154", - EMPTY, - "!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes", - "-,\u2013,\u2014,_", - "),],},>", - EMPTY, - EMPTY, - EMPTY, - "=", - "(,[,{,<", - "2", - EMPTY, - EMPTY, - "\u2019,\u201a,\u2018", - EMPTY, - EMPTY, - EMPTY, - "*", - "<", - EMPTY, - "\u2018,\u201a,\u2019", - "8", - EMPTY, - "!", - "9", - ")", - EMPTY, - "]", - "\u00b9,\u2081,\u00bd,\u2153,\u00bc,\u215b", - "\u201d,\u201e,\u201c", - EMPTY, - "\uff0a\uff03", - "^", - "@", - EMPTY, - "!fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm", - EMPTY, - "?,/", - "!icon/action_redo|!code/action_redo", - "6", - "!", - "7", - "}", - "!hasLabels!,!text/label_previous_key|!code/key_action_previous", - "+,=", - "!text/keyspec_right_single_angle_quote,!text/keyspec_left_single_angle_quote", - EMPTY, + "\u00a1,\u203d", "1", - EMPTY, - EMPTY, - "!text/keyspec_right_double_angle_quote,!text/keyspec_left_double_angle_quote", - "!hasLabels!,.net,.org,.gov,.edu", - "!text/keyspec_left_single_angle_quote,!text/keyspec_right_single_angle_quote", - "{", - "0", - "!text/keyspec_greater_than,!text/keyspec_right_curly_bracket,!text/keyspec_right_square_bracket", - EMPTY, - EMPTY, "#", EMPTY, - "\"", - "\\%", - "123", - "\\\\", - "\u201e,\u201c,\u201d", - "!fixedColumnOrder!4,!needsDividers!,!icon/action_switch_language|!code/action_switch_language,!icon/action_text_edit|!code/action_text_edit,!icon/action_clipboard_history|!code/action_clipboard_history,!icon/action_emoji|!code/action_emoji,!icon/previous_key|!code/key_action_previous,!icon/next_key|!code/key_action_next,!icon/action_undo|!code/action_undo,!icon/action_redo|!code/action_redo", - EMPTY, - "!icon/shortcut_key|!code/key_shortcut", - "!icon/action_paste|!code/action_paste", - "\u2079,\u2089", - "\u2078,\u2088", - EMPTY, - "#", - EMPTY, - "$,\u20ac,\u00a3,\u00a5,\u00a2", EMPTY, EMPTY, EMPTY, - "!icon/action_settings|!code/action_settings", - "5", - EMPTY, - "= \\\\ <", - "[", - "'", EMPTY, "\u2076,\u2086", - EMPTY, - "4", - "\u2074,\u2084", - "!icon/action_cut|!code/action_cut", - "&", - "!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", - EMPTY, - "%", - EMPTY, - "!text/keyspec_less_than,!text/keyspec_left_curly_bracket,!text/keyspec_left_square_bracket", - "!hasLabels!,!text/label_next_key|!code/key_action_next", - EMPTY, - EMPTY, - "3", - "!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes", - "!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes", - "!icon/action_select_all|!code/action_select_all", - "&,|", - ":", - "!icon/settings_key|!code/key_settings", + "'", "$", - "AM", + "<", + "&,|", + "!fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm", EMPTY, + "\\\\", EMPTY, - "\u201a,\u2018,\u2019", - EMPTY, - "!fixedColumnOrder!4,!needsDividers!,!icon/action_switch_language|!code/action_switch_language,!icon/action_text_edit|!code/action_text_edit,!icon/action_clipboard_history|!code/action_clipboard_history,!icon/action_emoji|!code/action_emoji,!icon/action_undo|!code/action_undo,!icon/action_redo|!code/action_redo", - EMPTY, - "~ [ <", - "PM", EMPTY, EMPTY, "@", - "(", - "\u00b3,\u2083,\u00be,\u215c", EMPTY, EMPTY, - "\u2075,\u2085,\u215d", + EMPTY, + "7", + EMPTY, + EMPTY, + EMPTY, + "\u2018,\u201a,\u2019", + "-,\u2013,\u2014,_", + EMPTY, "\u201c,\u201e,\u201d", + "!icon/action_select_all|!code/action_select_all", EMPTY, - ".com", + "!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes", + "9", EMPTY, + "0", + EMPTY, + "$,\u00a2,\u20ac,\u00a3,\u00a5,\u20b1", + EMPTY, + "!icon/action_undo|!code/action_undo", + "+,=", + EMPTY, + ">", + "\uff0a\uff03", + "!fixedColumnOrder!4,!needsDividers!,!icon/action_switch_language|!code/action_switch_language,!icon/action_text_edit|!code/action_text_edit,!icon/action_clipboard_history|!code/action_clipboard_history,!icon/action_emoji|!code/action_emoji,!icon/previous_key|!code/key_action_previous,!icon/next_key|!code/key_action_next,!icon/action_undo|!code/action_undo,!icon/action_redo|!code/action_redo", + "!", + "!text/keyspec_greater_than,!text/keyspec_right_curly_bracket,!text/keyspec_right_square_bracket", + "!", + EMPTY, + EMPTY, + "$,\u20ac,\u00a3,\u00a5,\u00a2", + "\u00b2,\u2082,\u2154", + "\u2075,\u2085,\u215d", + "\u2079,\u2089", + EMPTY, + "\\%", + "\u2019,\u201a,\u2018", + "\\%", + EMPTY, + EMPTY, + "\u201d,\u201e,\u201c", + "~ [ <", + "@", + "\u2077,\u2087,\u215e", + "\"", + EMPTY, + EMPTY, + "!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes", + EMPTY, + "4", + "!icon/action_redo|!code/action_redo", + "\u201e,\u201c,\u201d", + "(", + EMPTY, + "\u2070,\u2080,\u207f,\u2205", + "!text/keyspec_right_double_angle_quote,!text/keyspec_left_double_angle_quote", + EMPTY, + EMPTY, + "#", + EMPTY, + EMPTY, + ")", + "3", + EMPTY, + "\u2078,\u2088", + EMPTY, + EMPTY, + "!icon/action_copy|!code/action_copy", + "|", + EMPTY, + EMPTY, + "5", "\u2018,\u2019,\u201a", + "!text/keyspec_less_than,!text/keyspec_left_curly_bracket,!text/keyspec_left_square_bracket", + "PM", + "),],},>", + "\u2074,\u2084", + "!icon/action_settings|!code/action_settings", + "[", + EMPTY, + "!icon/settings_key|!code/key_settings", "*", - ">" + EMPTY, + "\u201c,\u201d,\u201e", + "123", + "=", + "]", + "*", + "!hasLabels!,!text/label_next_key|!code/key_action_next", + ";", + "AM", + "6", + "!icon/action_paste|!code/action_paste", + EMPTY, + "8", + "!text/keyspec_right_single_angle_quote,!text/keyspec_left_single_angle_quote", + "\u00b3,\u2083,\u00be,\u215c", + "2", + "!hasLabels!,.net,.org,.gov,.edu", + "&", + "(,[,{,<", + "!fixedColumnOrder!4,!needsDividers!,!icon/action_switch_language|!code/action_switch_language,!icon/action_text_edit|!code/action_text_edit,!icon/action_clipboard_history|!code/action_clipboard_history,!icon/action_emoji|!code/action_emoji,!icon/action_undo|!code/action_undo,!icon/action_redo|!code/action_redo", + "!icon/action_cut|!code/action_cut", + "^", + "}", + ":", + EMPTY, + "\u201a,\u2018,\u2019", + ".com", + "!icon/shortcut_key|!code/key_shortcut", + EMPTY, + "%", + "{", + EMPTY, + "\u00b9,\u2081,\u00bd,\u2153,\u00bc,\u215b", + "!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", + EMPTY, + "!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes", + "= \\\\ <", + EMPTY, + "?,/", + "!text/keyspec_left_single_angle_quote,!text/keyspec_right_single_angle_quote", + EMPTY, + "!hasLabels!,!text/label_previous_key|!code/key_action_previous" }; diff --git a/java/src/org/futo/inputmethod/latin/SystemBroadcastReceiver.java b/java/src/org/futo/inputmethod/latin/SystemBroadcastReceiver.java index cb6436c0e..bb6b26d2b 100644 --- a/java/src/org/futo/inputmethod/latin/SystemBroadcastReceiver.java +++ b/java/src/org/futo/inputmethod/latin/SystemBroadcastReceiver.java @@ -22,10 +22,9 @@ import android.content.Intent; import android.os.Process; import android.util.Log; import android.view.inputmethod.InputMethodManager; -import android.view.inputmethod.InputMethodSubtype; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.latin.utils.UncachedInputMethodManagerUtils; +import org.futo.inputmethod.v2keyboard.KeyboardLayoutSetV2; /** * This class detects the {@link Intent#ACTION_MY_PACKAGE_REPLACED} broadcast intent when this IME @@ -63,7 +62,7 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver { Log.i(TAG, "Boot has been completed"); } else if (Intent.ACTION_LOCALE_CHANGED.equals(intentAction)) { Log.i(TAG, "System locale changed"); - KeyboardLayoutSet.onSystemLocaleChanged(); + KeyboardLayoutSetV2.onSystemLocaleChanged(); } // The process that hosts this broadcast receiver is invoked and remains alive even after diff --git a/java/src/org/futo/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/org/futo/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index 82797b16d..1b5d93118 100644 --- a/java/src/org/futo/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/org/futo/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -18,21 +18,15 @@ package org.futo.inputmethod.latin.spellcheck; import android.content.Intent; import android.content.SharedPreferences; -import android.preference.PreferenceManager; import android.service.textservice.SpellCheckerService; -import android.text.InputType; -import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; import android.view.textservice.SuggestionsInfo; import org.futo.inputmethod.keyboard.Keyboard; -import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.latin.DictionaryFacilitator; import org.futo.inputmethod.latin.DictionaryFacilitatorLruCache; import org.futo.inputmethod.latin.NgramContext; import org.futo.inputmethod.latin.R; -import org.futo.inputmethod.latin.RichInputMethodSubtype; import org.futo.inputmethod.latin.SuggestedWords; import org.futo.inputmethod.latin.common.ComposedData; import org.futo.inputmethod.latin.settings.SettingsValuesForSuggestion; @@ -227,19 +221,20 @@ public final class AndroidSpellCheckerService extends SpellCheckerService final String keyboardLayoutName = getKeyboardLayoutNameForLocale(locale); final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype( locale.toString(), keyboardLayoutName); - final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype); - return keyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET); + throw new UnsupportedOperationException("TODO: Implement"); + //final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype); + //return keyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET); } - private KeyboardLayoutSet createKeyboardSetForSpellChecker(final InputMethodSubtype subtype) { + /*private KeyboardLayoutSet createKeyboardSetForSpellChecker(final InputMethodSubtype subtype) { final EditorInfo editorInfo = new EditorInfo(); editorInfo.inputType = InputType.TYPE_CLASS_TEXT; final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(this, editorInfo); builder.setKeyboardGeometry( SPELLCHECKER_DUMMY_KEYBOARD_WIDTH, SPELLCHECKER_DUMMY_KEYBOARD_HEIGHT); builder.setSubtype(RichInputMethodSubtype.getRichInputMethodSubtype(subtype)); - builder.setIsSpellChecker(true /* isSpellChecker */); + builder.setIsSpellChecker(true); builder.disableTouchPositionCorrectionData(); return builder.build(); - } + }*/ } diff --git a/java/src/org/futo/inputmethod/latin/uix/DynamicThemeProvider.kt b/java/src/org/futo/inputmethod/latin/uix/DynamicThemeProvider.kt index c550f1a83..28167ecad 100644 --- a/java/src/org/futo/inputmethod/latin/uix/DynamicThemeProvider.kt +++ b/java/src/org/futo/inputmethod/latin/uix/DynamicThemeProvider.kt @@ -1,7 +1,9 @@ package org.futo.inputmethod.latin.uix +import android.content.Context import android.content.res.TypedArray import android.graphics.drawable.Drawable +import android.view.ContextThemeWrapper import androidx.annotation.ColorInt import org.futo.inputmethod.v2keyboard.KeyVisualStyle @@ -55,5 +57,19 @@ interface DynamicThemeProvider { fun getDrawableOrDefault(i: Int, keyAttr: TypedArray, provider: DynamicThemeProvider?): Drawable? { return (provider?.getDrawable(i)) ?: keyAttr.getDrawable(i) } + + @JvmStatic + fun obtainFromContext(context: Context): DynamicThemeProvider { + if (context is DynamicThemeProviderOwner) { + return context.getDrawableProvider() + } else if (context is ContextThemeWrapper) { + val baseContext = context.baseContext + if (baseContext is DynamicThemeProviderOwner) { + return baseContext.getDrawableProvider() + } + } + + throw IllegalArgumentException("Could not find DynamicThemeProviderOwner") + } } } \ No newline at end of file diff --git a/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt b/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt index 0f986d8f0..1132a8e5c 100644 --- a/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt +++ b/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt @@ -372,8 +372,6 @@ data class BaseKey( /** * If set, overrides a default hint from the value of moreKeys. - * - * TODO: Currently does not override */ val hint: String? = null, ) : AbstractKey { diff --git a/java/src/org/futo/inputmethod/v2keyboard/KeyboardLayoutSet.kt b/java/src/org/futo/inputmethod/v2keyboard/KeyboardLayoutSet.kt index afea93293..0e00ed08b 100644 --- a/java/src/org/futo/inputmethod/v2keyboard/KeyboardLayoutSet.kt +++ b/java/src/org/futo/inputmethod/v2keyboard/KeyboardLayoutSet.kt @@ -268,6 +268,18 @@ Stack trace: ${e.stackTrace.map { it.toString() }} return errorLayout.build(context, keyboardParams, layoutParams) } } + + companion object { + @JvmStatic + fun onSystemLocaleChanged() { + + } + + @JvmStatic + fun onKeyboardThemeChanged() { + + } + } } public fun getKeyboardMode(editorInfo: EditorInfo): Int { diff --git a/java/src/org/futo/inputmethod/v2keyboard/LayoutEngine.kt b/java/src/org/futo/inputmethod/v2keyboard/LayoutEngine.kt index bb6780850..d0da20332 100644 --- a/java/src/org/futo/inputmethod/v2keyboard/LayoutEngine.kt +++ b/java/src/org/futo/inputmethod/v2keyboard/LayoutEngine.kt @@ -1,7 +1,6 @@ package org.futo.inputmethod.v2keyboard import android.content.Context -import android.view.ContextThemeWrapper import androidx.compose.ui.unit.Dp import org.futo.inputmethod.keyboard.KeyConsts import org.futo.inputmethod.keyboard.internal.KeyboardLayoutElement @@ -9,7 +8,6 @@ import org.futo.inputmethod.keyboard.internal.KeyboardParams import org.futo.inputmethod.latin.R import org.futo.inputmethod.latin.common.Constants import org.futo.inputmethod.latin.uix.DynamicThemeProvider -import org.futo.inputmethod.latin.uix.DynamicThemeProviderOwner import kotlin.math.floor import kotlin.math.roundToInt @@ -577,17 +575,9 @@ data class LayoutEngine( params.mBaseHeight = totalKeyboardHeight params.mDefaultRowHeight = rowHeightPx.roundToInt() - var provider: DynamicThemeProvider? = null - if (context is DynamicThemeProviderOwner) { - provider = (context as DynamicThemeProviderOwner).getDrawableProvider() - } else if (context is ContextThemeWrapper) { - val baseContext = (context as ContextThemeWrapper).baseContext - if (baseContext is DynamicThemeProviderOwner) { - provider = (baseContext as DynamicThemeProviderOwner).getDrawableProvider() - } - } + val provider = DynamicThemeProvider.obtainFromContext(context) - params.mIconsSet.loadIcons(null, provider!!) + params.mIconsSet.loadIcons(null, provider) params.mThemeId = 3 params.mTextsSet.setLocale(params.mId.locale, context) diff --git a/tests/src/org/futo/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/org/futo/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java index 6331b3b88..3e537b1e2 100644 --- a/tests/src/org/futo/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java +++ b/tests/src/org/futo/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java @@ -25,7 +25,6 @@ import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodSubtype; import org.futo.inputmethod.compat.InputMethodSubtypeCompatUtils; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet.Builder; import org.futo.inputmethod.latin.R; import org.futo.inputmethod.latin.RichInputMethodManager; import org.futo.inputmethod.latin.RichInputMethodSubtype; diff --git a/tests/src/org/futo/inputmethod/keyboard/action/ActionTestsBase.java b/tests/src/org/futo/inputmethod/keyboard/action/ActionTestsBase.java index 1ff4adbd0..96200155f 100644 --- a/tests/src/org/futo/inputmethod/keyboard/action/ActionTestsBase.java +++ b/tests/src/org/futo/inputmethod/keyboard/action/ActionTestsBase.java @@ -25,9 +25,7 @@ import android.view.inputmethod.InputMethodSubtype; import org.futo.inputmethod.keyboard.Key; import org.futo.inputmethod.keyboard.Keyboard; import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.KeyboardLayoutSetTestsBase; -import org.futo.inputmethod.keyboard.internal.KeyboardIconsSet; import org.futo.inputmethod.keyboard.layout.expected.ExpectedKeyVisual; import org.futo.inputmethod.latin.common.Constants; import org.futo.inputmethod.latin.common.LocaleUtils; diff --git a/tests/src/org/futo/inputmethod/keyboard/action/KlpActionLabelTests.java b/tests/src/org/futo/inputmethod/keyboard/action/KlpActionLabelTests.java index de3b1f73b..b35fd71d9 100644 --- a/tests/src/org/futo/inputmethod/keyboard/action/KlpActionLabelTests.java +++ b/tests/src/org/futo/inputmethod/keyboard/action/KlpActionLabelTests.java @@ -21,7 +21,6 @@ import android.test.suitebuilder.annotation.MediumTest; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.internal.KeyboardIconsSet; import org.futo.inputmethod.keyboard.internal.KeyboardTextsSet; import org.futo.inputmethod.latin.R; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/LayoutTestsBase.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/LayoutTestsBase.java index 11521b9b5..f3ef6b78b 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/LayoutTestsBase.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/LayoutTestsBase.java @@ -22,7 +22,6 @@ import android.view.inputmethod.InputMethodSubtype; import org.futo.inputmethod.keyboard.Key; import org.futo.inputmethod.keyboard.Keyboard; import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.KeyboardLayoutSetTestsBase; import org.futo.inputmethod.keyboard.KeyboardTheme; import org.futo.inputmethod.keyboard.layout.LayoutBase; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakEmail.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakEmail.java index 26105d500..e2269bcb6 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakEmail.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakEmail.java @@ -22,7 +22,6 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.layout.Dvorak; import org.futo.inputmethod.keyboard.layout.LayoutBase; import org.futo.inputmethod.keyboard.layout.customizer.DvorakCustomizer.EnglishDvorakCustomizer; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakUrl.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakUrl.java index 7b15635f7..3eca61eb0 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakUrl.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsDvorakUrl.java @@ -22,7 +22,6 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; import org.futo.inputmethod.keyboard.KeyboardId; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.layout.Dvorak; import org.futo.inputmethod.keyboard.layout.LayoutBase; import org.futo.inputmethod.keyboard.layout.customizer.DvorakCustomizer.EnglishDvorakCustomizer; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyEmail.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyEmail.java index 9521e7738..ab38fe19b 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyEmail.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyEmail.java @@ -21,7 +21,6 @@ import android.text.InputType; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.layout.LayoutBase; import org.futo.inputmethod.keyboard.layout.Qwerty; import org.futo.inputmethod.keyboard.layout.customizer.EnglishCustomizer; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyUrl.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyUrl.java index 454f6d90b..fa5a09f60 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyUrl.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsQwertyUrl.java @@ -21,7 +21,6 @@ import android.text.InputType; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.layout.LayoutBase; import org.futo.inputmethod.keyboard.layout.Qwerty; import org.futo.inputmethod.keyboard.layout.customizer.EnglishCustomizer; diff --git a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java index ac891a0db..ee0b58170 100644 --- a/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java +++ b/tests/src/org/futo/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java @@ -20,7 +20,6 @@ import android.test.suitebuilder.annotation.SmallTest; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; -import org.futo.inputmethod.keyboard.KeyboardLayoutSet; import org.futo.inputmethod.keyboard.layout.LayoutBase; import org.futo.inputmethod.keyboard.layout.Qwerty; import org.futo.inputmethod.keyboard.layout.customizer.EnglishCustomizer;