From dd0ba32804411863e61d166d355c3ec953a61383 Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Sun, 7 Jul 2024 21:25:36 +0300 Subject: [PATCH] Update settings categories. Add option for customizing long-press key layout. Draw icon key hints The texts for more keys have been updated: * morekeys_a should now include only letters relevant to the active language * morekeys_misc_a should include misc letters (accents, etc) not specifically needed for typing in the language The above still needs to be applied to most other languages. Only QWERTY has been updated with the new morekeys system. Other layouts still need to be updated. --- java/res/drawable/icon_spellcheck.xml | 6 + java/res/drawable/keyboard.xml | 25 + java/res/drawable/swipe_icon.xml | 5 + java/res/drawable/text_prediction.xml | 7 + java/res/drawable/themes.xml | 39 + java/res/xml/key_styles_common.xml | 4 +- java/res/xml/key_styles_enter.xml | 4 +- java/res/xml/rowkeys_qwerty1_left5.xml | 20 +- java/res/xml/rowkeys_qwerty1_right5.xml | 19 +- java/res/xml/rowkeys_qwerty2_left5.xml | 19 +- java/res/xml/rowkeys_qwerty2_right4.xml | 16 +- java/res/xml/rowkeys_qwerty3_left4.xml | 16 +- java/res/xml/rowkeys_qwerty3_right3.xml | 10 +- .../org/futo/inputmethod/keyboard/Key.java | 53 +- .../futo/inputmethod/keyboard/KeyboardId.java | 9 +- .../keyboard/KeyboardLayoutSet.java | 6 +- .../inputmethod/keyboard/KeyboardView.java | 23 +- .../keyboard/internal/KeyStyle.java | 20 +- .../keyboard/internal/KeyStylesSet.java | 25 +- .../keyboard/internal/KeyboardBuilder.java | 2 +- .../keyboard/internal/KeyboardTextsTable.java | 1905 +++++++++-------- .../latin/settings/LongPressKeySettings.kt | 104 + .../latin/uix/TextEditPopupActivity.kt | 13 +- .../futo/inputmethod/latin/uix/UixManager.kt | 2 +- .../latin/uix/settings/Components.kt | 4 +- .../latin/uix/settings/SettingsActivity.kt | 29 +- .../latin/uix/settings/SettingsNavigator.kt | 4 +- .../latin/uix/settings/pages/Home.kt | 33 +- .../latin/uix/settings/pages/Typing.kt | 537 ++++- .../latin/uix/theme/selector/ThemePicker.kt | 33 - .../org/futo/inputmethod/updates/Update.kt | 1 + .../locales/DEFAULT.json | 203 +- tools/make-keyboard-text-py/locales/en.json | 53 +- tools/make-keyboard-text-py/src/generate.py | 7 +- 34 files changed, 2098 insertions(+), 1158 deletions(-) create mode 100644 java/res/drawable/icon_spellcheck.xml create mode 100644 java/res/drawable/keyboard.xml create mode 100644 java/res/drawable/swipe_icon.xml create mode 100644 java/res/drawable/text_prediction.xml create mode 100644 java/res/drawable/themes.xml create mode 100644 java/src/org/futo/inputmethod/latin/settings/LongPressKeySettings.kt diff --git a/java/res/drawable/icon_spellcheck.xml b/java/res/drawable/icon_spellcheck.xml new file mode 100644 index 000000000..926eb62cc --- /dev/null +++ b/java/res/drawable/icon_spellcheck.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/java/res/drawable/keyboard.xml b/java/res/drawable/keyboard.xml new file mode 100644 index 000000000..1bea34220 --- /dev/null +++ b/java/res/drawable/keyboard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/drawable/swipe_icon.xml b/java/res/drawable/swipe_icon.xml new file mode 100644 index 000000000..6343e750f --- /dev/null +++ b/java/res/drawable/swipe_icon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/java/res/drawable/text_prediction.xml b/java/res/drawable/text_prediction.xml new file mode 100644 index 000000000..fd1523df2 --- /dev/null +++ b/java/res/drawable/text_prediction.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/java/res/drawable/themes.xml b/java/res/drawable/themes.xml new file mode 100644 index 000000000..c1509e132 --- /dev/null +++ b/java/res/drawable/themes.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index e7f343850..66b32eaf6 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -42,7 +42,7 @@ diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml index 6e998d648..71727c864 100644 --- a/java/res/xml/key_styles_enter.xml +++ b/java/res/xml/key_styles_enter.xml @@ -217,7 +217,7 @@ @@ -227,7 +227,7 @@ diff --git a/java/res/xml/rowkeys_qwerty1_left5.xml b/java/res/xml/rowkeys_qwerty1_left5.xml index 4258e6f3b..cdd9c071b 100644 --- a/java/res/xml/rowkeys_qwerty1_left5.xml +++ b/java/res/xml/rowkeys_qwerty1_left5.xml @@ -23,27 +23,17 @@ > + latin:moreKeys="!text/morekeys_q,!text/qwertysyms_q,!text/number_1,!text/actions_q" /> + latin:moreKeys="!text/morekeys_w,!text/qwertysyms_w,!text/number_2,!text/actions_w" /> + latin:moreKeys="!text/morekeys_e,!text/morekeys_misc_e,!text/qwertysyms_e,!text/number_3,!text/actions_e" /> + latin:moreKeys="!text/morekeys_r,!text/qwertysyms_r,!text/number_4,!text/actions_r" /> + latin:moreKeys="!text/morekeys_t,!text/qwertysyms_t,!text/number_5,!text/actions_t" /> diff --git a/java/res/xml/rowkeys_qwerty1_right5.xml b/java/res/xml/rowkeys_qwerty1_right5.xml index 2e4068af8..30dd5c4fa 100644 --- a/java/res/xml/rowkeys_qwerty1_right5.xml +++ b/java/res/xml/rowkeys_qwerty1_right5.xml @@ -23,26 +23,17 @@ > + latin:moreKeys="!text/morekeys_y,!text/qwertysyms_y,!text/number_6,!text/actions_y" /> + latin:moreKeys="!text/morekeys_u,!text/morekeys_misc_u,!text/qwertysyms_u,!text/number_7,!text/actions_u" /> + latin:moreKeys="!text/morekeys_i,!text/morekeys_misc_i,!text/qwertysyms_i,!text/number_8,!text/actions_i" /> + latin:moreKeys="!text/morekeys_o,!text/morekeys_misc_o,!text/qwertysyms_o,!text/number_9,!text/actions_o" /> + latin:moreKeys="!text/morekeys_p,!text/qwertysyms_p,!text/number_0,!text/actions_p" /> diff --git a/java/res/xml/rowkeys_qwerty2_left5.xml b/java/res/xml/rowkeys_qwerty2_left5.xml index df2e740a8..017ad1e61 100644 --- a/java/res/xml/rowkeys_qwerty2_left5.xml +++ b/java/res/xml/rowkeys_qwerty2_left5.xml @@ -23,26 +23,17 @@ > + latin:moreKeys="!text/morekeys_a,!text/morekeys_misc_a,!text/qwertysyms_a,!text/actions_a" /> + latin:moreKeys="!text/morekeys_s,!text/morekeys_misc_s,!text/qwertysyms_s,!text/actions_s" /> + latin:moreKeys="!text/morekeys_d,!text/qwertysyms_d,!text/actions_d" /> + latin:moreKeys="!text/morekeys_f,!text/qwertysyms_f,!text/actions_f" /> + latin:moreKeys="!text/morekeys_g,!text/qwertysyms_g,!text/actions_g" /> diff --git a/java/res/xml/rowkeys_qwerty2_right4.xml b/java/res/xml/rowkeys_qwerty2_right4.xml index 16279520d..245d84974 100644 --- a/java/res/xml/rowkeys_qwerty2_right4.xml +++ b/java/res/xml/rowkeys_qwerty2_right4.xml @@ -23,22 +23,14 @@ > + latin:moreKeys="!text/morekeys_h,!text/qwertysyms_h,!text/actions_h" /> + latin:moreKeys="!text/morekeys_j,!text/qwertysyms_j,!text/actions_j" /> + latin:moreKeys="!text/morekeys_k,!text/qwertysyms_k,!text/actions_k" /> + latin:moreKeys="!text/morekeys_l,!text/qwertysyms_l,!text/actions_l" /> diff --git a/java/res/xml/rowkeys_qwerty3_left4.xml b/java/res/xml/rowkeys_qwerty3_left4.xml index d037bd2bf..f0a29d179 100644 --- a/java/res/xml/rowkeys_qwerty3_left4.xml +++ b/java/res/xml/rowkeys_qwerty3_left4.xml @@ -23,22 +23,14 @@ > + latin:moreKeys="!text/morekeys_z,!text/qwertysyms_z,!text/actions_z" /> + latin:moreKeys="!text/morekeys_x,!text/qwertysyms_x,!text/actions_x" /> + latin:moreKeys="!text/morekeys_c,!text/morekeys_misc_c,!text/qwertysyms_c,!text/actions_c" /> + latin:moreKeys="!text/morekeys_v,!text/qwertysyms_v,!text/actions_v" /> diff --git a/java/res/xml/rowkeys_qwerty3_right3.xml b/java/res/xml/rowkeys_qwerty3_right3.xml index 6bd989467..389886b52 100644 --- a/java/res/xml/rowkeys_qwerty3_right3.xml +++ b/java/res/xml/rowkeys_qwerty3_right3.xml @@ -23,15 +23,11 @@ > + latin:moreKeys="!text/morekeys_b,!text/qwertysyms_b,!text/actions_b" /> + latin:moreKeys="!text/morekeys_n,!text/morekeys_misc_n,!text/qwertysyms_n,!text/actions_n" /> + latin:moreKeys="!text/morekeys_m,!text/qwertysyms_m,!text/actions_m" /> diff --git a/java/src/org/futo/inputmethod/keyboard/Key.java b/java/src/org/futo/inputmethod/keyboard/Key.java index bf97fceb3..70291b9b0 100644 --- a/java/src/org/futo/inputmethod/keyboard/Key.java +++ b/java/src/org/futo/inputmethod/keyboard/Key.java @@ -60,6 +60,7 @@ public class Key implements Comparable { private final String mLabel; /** Hint label to display on the key in conjunction with the label */ private final String mHintLabel; + private final String mHintIconId; /** Flags of the label */ private final int mLabelFlags; private static final int LABEL_FLAGS_ALIGN_HINT_LABEL_TO_BOTTOM = 0x02; @@ -215,6 +216,7 @@ public class Key implements Comparable { mHorizontalGap = horizontalGap; mVerticalGap = verticalGap; mHintLabel = hintLabel; + mHintIconId = ICON_UNDEFINED; mLabelFlags = labelFlags; mBackgroundType = backgroundType; // TODO: Pass keyActionFlags as an argument. @@ -287,7 +289,8 @@ public class Key implements Comparable { final boolean needsToUpcase = needsToUpcase(mLabelFlags, params.mId.mElementId); final Locale localeForUpcasing = params.mId.getLocale(); int actionFlags = style.getFlags(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); - String[] moreKeys = style.getStringArray(keyAttr, R.styleable.Keyboard_Key_moreKeys); + + String[] moreKeys = style.getStringArray(keyAttr, R.styleable.Keyboard_Key_moreKeys, s -> params.mId.mLongPressKeySettings.reorderMoreKeys(s)); // Get maximum column order number and set a relevant mode value. int moreKeysColumnAndFlags = MORE_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER @@ -320,7 +323,7 @@ public class Key implements Comparable { additionalMoreKeys = null; } else { additionalMoreKeys = style.getStringArray(keyAttr, - R.styleable.Keyboard_Key_additionalMoreKeys); + R.styleable.Keyboard_Key_additionalMoreKeys, null); } moreKeys = MoreKeySpec.insertAdditionalMoreKeys(moreKeys, additionalMoreKeys); @@ -357,28 +360,31 @@ public class Key implements Comparable { ? StringUtils.toTitleCaseOfKeyLabel(label, localeForUpcasing) : label; } + if ((mLabelFlags & LABEL_FLAGS_DISABLE_HINT_LABEL) != 0) { mHintLabel = null; + mHintIconId = null; } else { - String hintLabel = style.getString( - keyAttr, R.styleable.Keyboard_Key_keyHintLabel); - - if(params.mId.mNumberRow && hintLabel != null && hintLabel.matches("\\d+")) { - hintLabel = ""; - } + String hintLabel = null; + String hintIcon = null; if(moreKeys != null && moreKeys.length > 0) { String hintLabelCandidate = moreKeys[0]; if(hintLabelCandidate.startsWith("\\")) hintLabelCandidate = hintLabelCandidate.substring(1); if(hintLabelCandidate.length() == 1) { - hintLabel = hintLabelCandidate; + hintLabel = needsToUpcase + ? StringUtils.toTitleCaseOfKeyLabel(hintLabelCandidate, localeForUpcasing) + : hintLabelCandidate; + } else if(hintLabelCandidate.contains("!icon/")) { + hintIcon = KeySpecParser.getIconId(hintLabelCandidate); } } - mHintLabel = needsToUpcase - ? StringUtils.toTitleCaseOfKeyLabel(hintLabel, localeForUpcasing) - : hintLabel; + + mHintLabel = hintLabel; + mHintIconId = hintIcon; } + String outputText = KeySpecParser.getOutputText(keySpec); if (needsToUpcase) { outputText = StringUtils.toTitleCaseOfKeyLabel(outputText, localeForUpcasing); @@ -412,7 +418,7 @@ public class Key implements Comparable { : code; } final int altCodeInAttr = KeySpecParser.parseCode( - style.getString(keyAttr, R.styleable.Keyboard_Key_altCode), CODE_UNSPECIFIED); + style.getString(keyAttr, R.styleable.Keyboard_Key_altCode, null), CODE_UNSPECIFIED); final int altCode = needsToUpcase ? StringUtils.toTitleCaseOfKeyCode(altCodeInAttr, localeForUpcasing) : altCodeInAttr; @@ -435,6 +441,7 @@ public class Key implements Comparable { mCode = key.mCode; mLabel = key.mLabel; mHintLabel = key.mHintLabel; + mHintIconId = key.mHintIconId; mLabelFlags = key.mLabelFlags; mIconId = key.mIconId; mWidth = key.mWidth; @@ -487,6 +494,7 @@ public class Key implements Comparable { key.mCode, key.mLabel, key.mHintLabel, + key.mHintIconId, key.mIconId, key.mBackgroundType, Arrays.hashCode(key.mMoreKeys), @@ -514,6 +522,7 @@ public class Key implements Comparable { && o.mCode == mCode && TextUtils.equals(o.mLabel, mLabel) && TextUtils.equals(o.mHintLabel, mHintLabel) + && TextUtils.equals(o.mHintIconId, mHintIconId) && o.mIconId == mIconId && o.mBackgroundType == mBackgroundType && Arrays.equals(o.mMoreKeys, mMoreKeys) @@ -588,6 +597,11 @@ public class Key implements Comparable { return mHintLabel; } + @Nullable + public String getHintIconId() { + return mHintIconId; + } + @Nullable public MoreKeySpec[] getMoreKeys() { return mMoreKeys; @@ -840,6 +854,19 @@ public class Key implements Comparable { return icon; } + @Nullable + public Drawable getHintIcon(final KeyboardIconsSet iconSet, final int alpha) { + final OptionalAttributes attrs = mOptionalAttributes; + final String iconId = getHintIconId(); + if(iconId == null) return null; + + final Drawable icon = iconSet.getIconDrawable(iconId); + if (icon != null) { + icon.setAlpha(alpha); + } + return icon; + } + @Nullable public Drawable getPreviewIcon(final KeyboardIconsSet iconSet) { return iconSet.getIconDrawable(getIconId()); diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java index 4d0af2982..8bac39807 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java @@ -24,6 +24,7 @@ import android.view.inputmethod.EditorInfo; import org.futo.inputmethod.compat.EditorInfoCompatUtils; import org.futo.inputmethod.latin.RichInputMethodSubtype; +import org.futo.inputmethod.latin.settings.LongPressKeySettings; import org.futo.inputmethod.latin.utils.InputTypeUtils; import java.util.Arrays; @@ -84,6 +85,7 @@ public final class KeyboardId { public final boolean mHasShortcutKey; public final boolean mIsSplitLayout; public final boolean mNumberRow; + public final LongPressKeySettings mLongPressKeySettings; private final int mHashCode; @@ -102,6 +104,7 @@ public final class KeyboardId { mHasShortcutKey = params.mVoiceInputKeyEnabled; mIsSplitLayout = params.mIsSplitLayoutEnabled; mNumberRow = params.mNumberRow || params.mIsPasswordField; + mLongPressKeySettings = params.mLongPressKeySettings; mHashCode = computeHashCode(this); } @@ -124,7 +127,8 @@ public final class KeyboardId { id.navigatePrevious(), id.mSubtype, id.mIsSplitLayout, - id.mNumberRow + id.mNumberRow, + id.mLongPressKeySettings.hashCode() }); } @@ -147,7 +151,8 @@ public final class KeyboardId { && other.navigatePrevious() == navigatePrevious() && other.mSubtype.equals(mSubtype) && other.mIsSplitLayout == mIsSplitLayout - && other.mNumberRow == mNumberRow; + && other.mNumberRow == mNumberRow + && other.mLongPressKeySettings.equals(mLongPressKeySettings); } private static boolean isAlphabetKeyboard(final int elementId) { diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java index 65667e65d..2243c5dfa 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java @@ -39,7 +39,7 @@ 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.define.DebugFlags; +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; @@ -136,6 +136,8 @@ public final class KeyboardLayoutSet { new SparseArray<>(); boolean mNumberRow; + + LongPressKeySettings mLongPressKeySettings; } public static void onSystemLocaleChanged() { @@ -272,6 +274,8 @@ public final class KeyboardLayoutSet { 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}. diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardView.java b/java/src/org/futo/inputmethod/keyboard/KeyboardView.java index b246f3429..f93cade39 100644 --- a/java/src/org/futo/inputmethod/keyboard/KeyboardView.java +++ b/java/src/org/futo/inputmethod/keyboard/KeyboardView.java @@ -142,9 +142,15 @@ public class KeyboardView extends View { R.styleable.Keyboard_Key, defStyle, R.style.KeyboardView); assert(context instanceof ContextThemeWrapper); - assert(((ContextThemeWrapper) context).getBaseContext() instanceof DynamicThemeProviderOwner); - mDrawableProvider = ((DynamicThemeProviderOwner) ((ContextThemeWrapper) context).getBaseContext()).getDrawableProvider(); + 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"); + } + boolean isMoreKeys = keyAttr.getBoolean(R.styleable.Keyboard_Key_isMoreKey, false); boolean isMoreKeysAction = keyAttr.getBoolean(R.styleable.Keyboard_Key_isAction, false); @@ -419,6 +425,8 @@ public class KeyboardView extends View { final Keyboard keyboard = getKeyboard(); final Drawable icon = (keyboard == null) ? null : key.getIcon(keyboard.mIconsSet, params.mAnimAlpha); + final Drawable hintIcon = (keyboard == null) ? null + : key.getHintIcon(keyboard.mIconsSet, params.mAnimAlpha); float labelX = centerX; float labelBaseline = centerY; final String label = key.getLabel(); @@ -510,6 +518,17 @@ public class KeyboardView extends View { final float adjustmentY = params.mHintLabelVerticalAdjustment * labelCharHeight; canvas.drawText( hintLabel, 0, hintLabel.length(), hintX, hintBaseline + adjustmentY, paint); + } else if(hintIcon != null) { + final float size = key.selectHintTextSize(params); + + int iconWidth = (int)size; + int iconHeight = (int)size; + + int hintX = keyWidth - iconWidth - (int)mKeyHintLetterPadding; + int hintY = (int)mKeyHintLetterPadding; + + hintIcon.setTint(key.selectHintTextColor(params)); + drawIcon(canvas, hintIcon, hintX, hintY, iconWidth, iconHeight); } // Draw key icon. diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyStyle.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyStyle.java index e0f5ea049..9496583af 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyStyle.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyStyle.java @@ -18,14 +18,16 @@ package org.futo.inputmethod.keyboard.internal; import android.content.res.TypedArray; +import java.util.function.Function; + import javax.annotation.Nonnull; import javax.annotation.Nullable; public abstract class KeyStyle { private final KeyboardTextsSet mTextsSet; - public abstract @Nullable String[] getStringArray(TypedArray a, int index); - public abstract @Nullable String getString(TypedArray a, int index); + public abstract @Nullable String[] getStringArray(TypedArray a, int index, Function stringMutator); + public abstract @Nullable String getString(TypedArray a, int index, Function stringMutator); public abstract int getInt(TypedArray a, int index, int defaultValue); public abstract int getFlags(TypedArray a, int index); @@ -34,17 +36,23 @@ public abstract class KeyStyle { } @Nullable - protected String parseString(final TypedArray a, final int index) { + protected String parseString(final TypedArray a, final int index, Function stringMutator) { if (a.hasValue(index)) { - return mTextsSet.resolveTextReference(a.getString(index)); + String s = a.getString(index); + if(stringMutator != null) s = stringMutator.apply(s); + + return mTextsSet.resolveTextReference(s); } return null; } @Nullable - protected String[] parseStringArray(final TypedArray a, final int index) { + protected String[] parseStringArray(final TypedArray a, final int index, Function stringMutator) { if (a.hasValue(index)) { - final String text = mTextsSet.resolveTextReference(a.getString(index)); + String s = a.getString(index); + if(stringMutator != null) s = stringMutator.apply(s); + + final String text = mTextsSet.resolveTextReference(s); return MoreKeySpec.splitKeySpecs(text); } return null; diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java index 956b17b60..059cb6514 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyStylesSet.java @@ -28,6 +28,7 @@ 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; @@ -59,14 +60,14 @@ public final class KeyStylesSet { @Override @Nullable - public String[] getStringArray(final TypedArray a, final int index) { - return parseStringArray(a, index); + 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) { - return parseString(a, index); + public String getString(final TypedArray a, final int index, Function stringMutator) { + return parseString(a, index, stringMutator); } @Override @@ -95,9 +96,9 @@ public final class KeyStylesSet { @Override @Nullable - public String[] getStringArray(final TypedArray a, final int index) { + public String[] getStringArray(final TypedArray a, final int index, Function stringMutator) { if (a.hasValue(index)) { - return parseStringArray(a, index); + return parseStringArray(a, index, stringMutator); } final Object value = mStyleAttributes.get(index); if (value != null) { @@ -105,21 +106,21 @@ public final class KeyStylesSet { return Arrays.copyOf(array, array.length); } final KeyStyle parentStyle = mStyles.get(mParentStyleName); - return parentStyle.getStringArray(a, index); + return parentStyle.getStringArray(a, index, stringMutator); } @Override @Nullable - public String getString(final TypedArray a, final int index) { + public String getString(final TypedArray a, final int index, Function stringMutator) { if (a.hasValue(index)) { - return parseString(a, 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); + return parentStyle.getString(a, index, stringMutator); } @Override @@ -159,7 +160,7 @@ public final class KeyStylesSet { private void readString(final TypedArray a, final int index) { if (a.hasValue(index)) { - mStyleAttributes.put(index, parseString(a, index)); + mStyleAttributes.put(index, parseString(a, index, null)); } } @@ -179,7 +180,7 @@ public final class KeyStylesSet { private void readStringArray(final TypedArray a, final int index) { if (a.hasValue(index)) { - mStyleAttributes.put(index, parseStringArray(a, index)); + mStyleAttributes.put(index, parseStringArray(a, index, null)); } } } diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java index f676eb17d..454ba918e 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -512,7 +512,7 @@ public class KeyboardBuilder { 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); + final String keySpec = keyStyle.getString(keyAttr, R.styleable.Keyboard_Key_keySpec, null); if (TextUtils.isEmpty(keySpec)) { throw new ParseException("Empty keySpec", parser); } diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java index a2d8c215b..c660772e7 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -93,173 +93,267 @@ public final class KeyboardTextsTable { "morekeys_c", "morekeys_n", "double_quotes", - "morekeys_s", "single_quotes", + "morekeys_s", "keyspec_currency", "morekeys_y", "morekeys_z", "morekeys_d", - "double_angle_quotes", - "morekeys_l", - "morekeys_g", "single_angle_quotes", + "double_angle_quotes", + "morekeys_g", + "morekeys_l", "morekeys_t", "morekeys_r", "morekeys_cyrillic_ie", - "keyspec_symbols_9", - "morekeys_cyrillic_soft_sign", - "additional_morekeys_symbols_0", - "additional_morekeys_symbols_4", - "keyspec_east_slavic_row2_2", - "morekeys_nordic_row2_10", - "keyspec_symbols_8", - "keyspec_symbols_0", - "additional_morekeys_symbols_5", - "additional_morekeys_symbols_1", - "morekeys_tablet_period", "keyspec_symbols_6", - "keylabel_to_symbol", - "keyspec_symbols_3", - "keyspec_symbols_1", - "keyspec_nordic_row2_10", - "keyspec_symbols_7", - "keyspec_symbols_4", - "additional_morekeys_symbols_9", + "additional_morekeys_symbols_5", "additional_morekeys_symbols_6", - "additional_morekeys_symbols_3", - "morekeys_k", - "keyspec_east_slavic_row3_5", + "additional_morekeys_symbols_2", + "morekeys_tablet_period", + "additional_morekeys_symbols_1", + "additional_morekeys_symbols_4", + "keyspec_east_slavic_row1_9", "additional_morekeys_symbols_7", "keyspec_nordic_row1_11", - "additional_morekeys_symbols_2", - "keyspec_nordic_row2_11", "keyspec_symbols_2", + "additional_morekeys_symbols_3", "keyspec_east_slavic_row2_11", + "additional_morekeys_symbols_0", + "keylabel_to_symbol", "keyspec_symbols_5", - "keyspec_east_slavic_row1_9", + "keyspec_east_slavic_row2_2", + "keyspec_symbols_9", + "keyspec_symbols_7", + "keyspec_symbols_4", + "keyspec_east_slavic_row3_5", + "keyspec_symbols_3", + "keyspec_symbols_8", + "morekeys_k", + "additional_morekeys_symbols_9", + "keyspec_symbols_0", + "keyspec_nordic_row2_11", "additional_morekeys_symbols_8", - "morekeys_punctuation", - "morekeys_nordic_row2_11", + "morekeys_cyrillic_soft_sign", + "keyspec_nordic_row2_10", + "keyspec_symbols_1", + "morekeys_nordic_row2_10", "keyspec_tablet_comma", - "keyspec_period", "morekeys_period", "keyspec_tablet_period", - "keyspec_less_than", - "keyspec_left_square_bracket", - "keyspec_less_than_equal", - "morekeys_tablet_comma", - "keyspec_left_single_angle_quote", - "morekeys_swiss_row2_10", - "keyspec_left_parenthesis", - "keyspec_comma", - "keyspec_right_parenthesis", - "keyspec_swiss_row2_10", - "keyspec_right_single_angle_quote", - "keyspec_left_curly_bracket", - "morekeys_swiss_row1_11", + "keyspec_period", + "morekeys_punctuation", + "morekeys_nordic_row2_11", "keyspec_left_double_angle_quote", - "keyspec_greater_than_equal", - "keyspec_greater_than", - "keyhintlabel_period", - "morekeys_question", + "keyspec_left_parenthesis", + "morekeys_swiss_row2_10", "keyspec_right_double_angle_quote", + "keyspec_swiss_row2_10", + "keyspec_right_parenthesis", + "keyspec_right_single_angle_quote", "keyspec_right_curly_bracket", "keyspec_swiss_row2_11", + "keyspec_less_than", + "keyspec_greater_than", + "keyhintlabel_period", + "keyspec_right_square_bracket", + "keyspec_greater_than_equal", + "keyspec_left_single_angle_quote", + "keyspec_comma", + "morekeys_tablet_comma", "keyspec_spanish_row2_10", "keyspec_swiss_row1_11", - "keyspec_right_square_bracket", + "keyspec_left_curly_bracket", + "morekeys_question", + "keyspec_left_square_bracket", + "keyspec_less_than_equal", "morekeys_star", "morekeys_swiss_row2_11", - "label_next_key", - "morekeys_cyrillic_o", - "label_previous_key", - "label_search_key", - "label_pause_key", - "keyspec_symbols_question", - "keyhintlabel_tablet_comma", - "keyspec_south_slavic_row3_8", - "morekeys_right_parenthesis", - "morekeys_w", - "morekeys_symbols_semicolon", - "keyspec_south_slavic_row2_11", + "morekeys_swiss_row1_11", "morekeys_cyrillic_u", - "morekeys_symbols_percent", - "morekeys_left_parenthesis", - "morekeys_tablet_punctuation", - "keyhintlabel_tablet_period", - "morekeys_arabic_diacritics", - "keyspec_symbols_semicolon", - "label_send_key", - "morekeys_east_slavic_row2_2", - "label_go_key", - "keyspec_symbols_percent", - "keyspec_south_slavic_row3_1", - "morekeys_cyrillic_i", "label_wait_key", - "keyspec_south_slavic_row1_6", - "morekeys_h", - "morekeys_cyrillic_en", - "morekeys_cyrillic_ghe", "morekeys_bullet", + "keyhintlabel_tablet_comma", + "morekeys_w", + "morekeys_cyrillic_o", + "keyhintlabel_tablet_period", + "morekeys_cyrillic_ghe", + "morekeys_h", + "label_send_key", + "label_go_key", + "label_next_key", + "keyspec_south_slavic_row2_11", + "morekeys_tablet_punctuation", + "morekeys_east_slavic_row2_2", + "keyspec_symbols_semicolon", + "label_pause_key", + "keyspec_south_slavic_row3_1", + "label_search_key", + "morekeys_right_parenthesis", + "morekeys_arabic_diacritics", + "keyspec_symbols_question", + "keyspec_symbols_percent", + "morekeys_cyrillic_i", + "keyspec_south_slavic_row1_6", + "label_previous_key", + "morekeys_symbols_semicolon", + "morekeys_symbols_percent", "label_done_key", - "keyspec_x", - "keyspec_w", - "morekeys_exclamation", - "morekeys_cyrillic_a", - "morekeys_less_than", - "keyspec_y", + "keyspec_south_slavic_row3_8", + "morekeys_cyrillic_en", + "morekeys_left_parenthesis", "morekeys_v", - "morekeys_plus", - "keyspec_q", "morekeys_greater_than", - "morekeys_currency_dollar", - "morekeys_cyrillic_ka", - "morekeys_q", + "keyspec_q", + "keyspec_y", "morekeys_east_slavic_row2_11", - "morekeys_j", + "morekeys_plus", "morekeys_x", - "single_9qm_rqm", - "single_lqm_rqm", - "double_lqm_rqm", - "double_laqm_raqm", - "keylabel_to_more_symbol", - "keylabel_time_pm", - "keyspecs_left_parenthesis_more_keys", - "morekeys_symbols_4", - "double_9qm_lqm", - "keylabel_to_phone_numeric", - "single_laqm_raqm", - "morekeys_symbols_5", - "keylabel_to_phone_symbols", - "morekeys_single_quote", - "morekeys_double_quote", - "keyspec_emoji_action_key", - "keyspec_settings", - "keyspec_shortcut", - "double_9qm_rqm", - "single_rqm_9qm", - "double_raqm_laqm", - "keylabel_time_am", - "morekeys_symbols_7", - "morekeys_symbols_9", - "keyspec_action_next", - "morekeys_popular_domain", - "morekeys_symbols_3", - "morekeys_symbols_0", - "morekeys_symbols_1", - "keylabel_tablet_to_more_symbol", - "single_9qm_lqm", - "morekeys_symbols_6", - "keyspec_popular_domain", - "single_raqm_laqm", - "morekeys_symbols_2", - "keyspecs_right_parenthesis_more_keys", - "morekeys_symbols_8", - "morekeys_currency_generic", - "keyspec_action_previous", - "morekeys_tablet_double_quote", + "morekeys_currency_dollar", + "keyspec_w", + "morekeys_less_than", + "morekeys_cyrillic_ka", + "keyspec_x", + "morekeys_q", + "morekeys_exclamation", + "morekeys_j", + "morekeys_cyrillic_a", "morekeys_am_pm", - "double_rqm_9qm" + "actions_l", + "actions_h", + "actions_y", + "morekeys_symbols_4", + "keylabel_to_phone_numeric", + "qwertysyms_g", + "qwertysyms_a", + "actions_c", + "qwertysyms_f", + "actions_9", + "single_9qm_lqm", + "morekeys_m", + "morekeys_tablet_double_quote", + "double_9qm_rqm", + "number_1", + "qwertysyms_y", + "qwertysyms_7", + "qwertysyms_l", + "keyspec_emoji_action_key", + "number_8", + "keyspecs_left_parenthesis_more_keys", + "morekeys_misc_u", + "keyspec_action_next", + "keyspec_action_previous", + "morekeys_symbols_9", + "qwertysyms_6", + "qwertysyms_m", + "actions_o", + "double_9qm_lqm", + "actions_w", + "actions_g", + "actions_e", + "actions_r", + "actions_k", + "morekeys_f", + "actions_5", + "double_raqm_laqm", + "morekeys_symbols_2", + "morekeys_misc_n", + "morekeys_misc_e", + "qwertysyms_j", + "actions_m", + "number_6", + "actions_f", + "morekeys_popular_domain", + "single_lqm_rqm", + "number_0", + "morekeys_symbols_5", + "actions_7", + "qwertysyms_e", + "morekeys_single_quote", + "single_9qm_rqm", + "actions_p", + "actions_x", + "morekeys_double_quote", + "qwertysyms_0", + "single_laqm_raqm", + "keyspec_settings", + "qwertysyms_p", + "keylabel_time_am", + "qwertysyms_t", + "actions_z", + "number_5", + "qwertysyms_8", + "qwertysyms_2", + "qwertysyms_s", + "qwertysyms_n", + "qwertysyms_o", + "qwertysyms_r", + "qwertysyms_b", + "actions_6", + "keylabel_to_more_symbol", + "qwertysyms_5", + "qwertysyms_u", + "single_raqm_laqm", + "morekeys_misc_a", + "morekeys_misc_s", + "qwertysyms_c", + "double_lqm_rqm", + "qwertysyms_i", + "actions_2", + "single_rqm_9qm", + "morekeys_p", + "qwertysyms_d", + "number_7", + "number_2", + "morekeys_misc_c", + "keylabel_time_pm", + "qwertysyms_k", + "qwertysyms_q", + "actions_t", + "actions_j", + "qwertysyms_v", + "number_4", + "double_rqm_9qm", + "morekeys_b", + "morekeys_symbols_1", + "actions_0", + "morekeys_symbols_3", + "qwertysyms_9", + "qwertysyms_z", + "keyspec_shortcut", + "qwertysyms_h", + "morekeys_symbols_0", + "actions_q", + "number_3", + "qwertysyms_1", + "actions_u", + "actions_4", + "actions_s", + "number_9", + "keyspec_popular_domain", + "morekeys_misc_i", + "double_laqm_raqm", + "actions_a", + "actions_n", + "actions_b", + "morekeys_misc_o", + "morekeys_currency_generic", + "morekeys_symbols_7", + "qwertysyms_4", + "actions_d", + "keylabel_tablet_to_more_symbol", + "keyspecs_right_parenthesis_more_keys", + "morekeys_symbols_6", + "morekeys_symbols_8", + "actions_v", + "qwertysyms_x", + "actions_3", + "qwertysyms_3", + "keylabel_to_phone_symbols", + "actions_1", + "qwertysyms_w", + "actions_8", + "actions_i" }; private static final String EMPTY = ""; @@ -305,101 +399,102 @@ public final class KeyboardTextsTable { null, null, null, - "\u0669", - null, - "0,\u066b,\u066c", - "4", - null, - null, - "\u0668", - "\u0660", - "5", - "1", - "!text/morekeys_arabic_diacritics", "\u0666", - "\u0663\u0662\u0661\u061f", - "\u0663", - "\u0661", - null, - "\u0667", - "\u0664", - "9", + "5", "6", - "3", - null, + "2", + "!text/morekeys_arabic_diacritics", + "1", + "4", null, "7", null, - "2", - null, "\u0662", + "3", null, + "0,\u066b,\u066c", + "\u0663\u0662\u0661\u061f", "\u0665", null, + "\u0669", + "\u0667", + "\u0664", + null, + "\u0663", + "\u0668", + null, + "9", + "\u0660", + null, "8", null, null, - "\u060c", + "\u0661", null, + "\u060c", "!text/morekeys_arabic_diacritics", null, - "<|>", - "[|]", - "\u2264|\u2265", - "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,\\\",\\'", - "\u2039|\u203a", null, - "(|)", - "\u060c", - ")|(", null, - "\u203a|\u2039", - "{|}", null, "\u00ab|\u00bb", - "\u2265|\u2264", - ">|<", - "\u0651", - "?,\u00bf", + "(|)", + null, "\u00bb|\u00ab", + null, + ")|(", + "\u203a|\u2039", "}|{", null, - null, - null, + "<|>", + ">|<", + "\u0651", "]|[", + "\u2265|\u2264", + "\u2039|\u203a", + "\u060c", + "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,\\\",\\'", + null, + null, + "{|}", + "?,\u00bf", + "[|]", + "\u2264|\u2265", "\u2605,\u066d", null, null, null, null, - null, - null, - "\u061f", + "\u266a", "\u061f", null, - "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", - null, - ";", - null, - null, - "\\%,\u2030", - "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", null, "\u0651", - "!fixedColumnOrder!7, \u0655|\u0655, \u0654|\u0654, \u0652|\u0652, \u064d|\u064d, \u064c|\u064c, \u064b|\u064b, \u0651|\u0651, \u0656|\u0656, \u0670|\u0670, \u0653|\u0653, \u0650|\u0650, \u064f|\u064f, \u064e|\u064e,\u0640\u0640\u0640|\u0640", + null, + null, + null, + null, + null, + null, + null, + null, "\u061b", null, null, null, + "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", + "!fixedColumnOrder!7, \u0655|\u0655, \u0654|\u0654, \u0652|\u0652, \u064d|\u064d, \u064c|\u064c, \u064b|\u064b, \u0651|\u0651, \u0656|\u0656, \u0670|\u0670, \u0653|\u0653, \u0650|\u0650, \u064f|\u064f, \u064e|\u064e,\u0640\u0640\u0640|\u0640", + "\u061f", "\u066a", null, null, null, + ";", + "\\%,\u2030", null, null, null, - null, - "\u266a" + "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys" }; private static final String[] TEXTS_az = { @@ -413,8 +508,8 @@ public final class KeyboardTextsTable { "\u00e7,\u0107,\u010d", "\u0148,\u00f1", null, - "\u015f,\u00df,\u015b,\u0161", null, + "\u015f,\u00df,\u015b,\u0161", null, "\u00fd", "\u017e", @@ -435,7 +530,6 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", null, null, @@ -447,38 +541,37 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u0451", null, - "\u044a", + null, + null, + null, + null, + null, + null, + "\u045e", + null, + null, + null, + null, + "\u044d", + null, null, null, "\u044b", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0456", null, null, null, null, null, - "\u044d", null, - "\u045e" + null, + "\u044a" }; private static final String[] TEXTS_bg = { @@ -544,6 +637,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "l\u00b7l,\u0142", null, null, @@ -582,6 +677,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "!autoColumnOrder!9,\\,?,!,\u00b7,#,),(,/,;,',@,:,-,\\\",+,\\%,&", null, null, @@ -601,14 +698,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, "\u00e7", null, null, @@ -629,6 +718,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "!autoColumnOrder!8,\\,',\u00b7,#,),(,/,;,@,:,-,\\\",+,\\%,&" }; @@ -643,16 +734,16 @@ public final class KeyboardTextsTable { "\u010d,\u00e7,\u0107", "\u0148,\u00f1,\u0144", "!text/double_9qm_lqm", - "\u0161,\u00df,\u015b", "!text/single_9qm_lqm", + "\u0161,\u00df,\u015b", null, "\u00fd,\u00ff", "\u017e,\u017a,\u017c", "\u010f", + "!text/single_raqm_laqm", "!text/double_raqm_laqm", null, null, - "!text/single_raqm_laqm", "\u0165", "\u0159" }; @@ -668,16 +759,17 @@ public final class KeyboardTextsTable { null, "\u00f1,\u0144", "!text/double_9qm_lqm", - "\u00df,\u015b,\u0161", "!text/single_9qm_lqm", + "\u00df,\u015b,\u0161", null, "\u00fd,\u00ff", null, "\u00f0", + "!text/single_raqm_laqm", "!text/double_raqm_laqm", + null, "\u0142", null, - "!text/single_raqm_laqm", null, null, null, @@ -686,30 +778,33 @@ public final class KeyboardTextsTable { null, null, null, - "\u00e4", - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u00e6", - null, - null, - null, - null, - null, null, null, null, "\u00e5", null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00f8", null, null, + "\u00e6", + null, + "\u00e4", + null, null, null, null, @@ -728,17 +823,14 @@ public final class KeyboardTextsTable { null, "\u00f1,\u0144", "!text/double_9qm_lqm", - "\u00df,\u015b,\u0161", "!text/single_9qm_lqm", + "\u00df,\u015b,\u0161", null, null, null, null, - "!text/double_raqm_laqm", - null, - null, "!text/single_raqm_laqm", - null, + "!text/double_raqm_laqm", null, null, null, @@ -786,25 +878,28 @@ public final class KeyboardTextsTable { null, "\u00e9", null, - null, - null, "\u00f6", null, null, - "\u00e8", - null, - null, - null, - null, - null, - null, null, "\u00e4", null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00fc", null, null, - "\u00e0" + null, + null, + null, + "\u00e0", + "\u00e8" }; private static final String[] TEXTS_el = { @@ -816,17 +911,7 @@ public final class KeyboardTextsTable { }; private static final String[] TEXTS_en = { - "en", - "\u00e0,\u00e1,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", - "\u00f3,\u00f4,\u00f6,\u00f2,\u0153,\u00f8,\u014d,\u00f5", - "\u00e9,\u00e8,\u00ea,\u00eb,\u0113", - null, - "\u00fa,\u00fb,\u00fc,\u00f9,\u016b", - "\u00ed,\u00ee,\u00ef,\u012b,\u00ec", - "\u00e7", - "\u00f1", - null, - "\u00df" + "en" }; private static final String[] TEXTS_eo = { @@ -840,16 +925,16 @@ public final class KeyboardTextsTable { "\u0107,\u010d,\u00e7,\u010b", "\u00f1,\u0144,\u0146,\u0148,\u0149,\u014b", null, - "\u00df,\u0161,\u015b,\u0219,\u015f", null, + "\u00df,\u0161,\u015b,\u0219,\u015f", null, "y,\u00fd,\u0177,\u00ff,\u00fe", "\u017a,\u017c,\u017e", "\u00f0,\u010f,\u0111", null, - "\u013a,\u013c,\u013e,\u0140,\u0142", - "\u011f,\u0121,\u0123", null, + "\u011f,\u0121,\u0123", + "\u013a,\u013c,\u013e,\u0140,\u0142", "\u0165,\u021b,\u0163,\u0167", "\u0159,\u0155,\u0157", null, @@ -874,6 +959,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u0137,\u0138", null, null, @@ -906,12 +993,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, "\u0135", null, null, @@ -925,46 +1006,47 @@ public final class KeyboardTextsTable { null, null, null, - null, "w,\u0175", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0125,\u0127", null, null, null, null, - "\u0109", - "\u011d", null, null, null, - "\u016d", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "w,\u0175", null, "\u015d", + "\u016d", null, null, + "x", null, - "q", + "\u011d", null, null, - "x" + "\u0109", + "q" }; private static final String[] TEXTS_es = { @@ -1023,6 +1105,10 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, "!autoColumnOrder!9,\\,?,!,#,),(,/,;,\u00a1,',@,:,-,\\\",+,\\%,&,\u00bf" }; @@ -1037,16 +1123,16 @@ public final class KeyboardTextsTable { "\u010d,\u00e7,\u0107", "\u0146,\u00f1,\u0144", "!text/double_9qm_lqm", - "\u0161,\u00df,\u015b,\u015f", "!text/single_9qm_lqm", + "\u0161,\u00df,\u015b,\u015f", null, "\u00fd,\u00ff", "\u017e,\u017c,\u017a", "\u010f", null, - "\u013c,\u0142,\u013a,\u013e", - "\u0123,\u011f", null, + "\u0123,\u011f", + "\u013c,\u0142,\u013a,\u013e", "\u0163,\u0165", "\u0157,\u0159,\u0155", null, @@ -1055,7 +1141,11 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f5", + null, + null, + null, + null, + "\u00fc", null, null, null, @@ -1065,8 +1155,6 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f6", - null, null, null, null, @@ -1074,9 +1162,12 @@ public final class KeyboardTextsTable { "\u0137", null, null, - "\u00fc", + "\u00e4", null, - "\u00e4" + null, + "\u00f6", + null, + "\u00f5" }; private static final String[] TEXTS_eu = { @@ -1115,112 +1206,112 @@ public final class KeyboardTextsTable { null, null, null, - "\u06f9", - null, - "0,\u066b,\u066c", - "4", - null, - null, - "\u06f8", - "\u06f0", - "5", - "1", - "!text/morekeys_arabic_diacritics", "\u06f6", - "\u06f3\u06f2\u06f1\u061f", - "\u06f3", - "\u06f1", - null, - "\u06f7", - "\u06f4", - "9", + "5", "6", - "3", - null, + "2", + "!text/morekeys_arabic_diacritics", + "1", + "4", null, "7", null, - "2", - null, "\u06f2", + "3", null, + "0,\u066b,\u066c", + "\u06f3\u06f2\u06f1\u061f", "\u06f5", null, + "\u06f9", + "\u06f7", + "\u06f4", + null, + "\u06f3", + "\u06f8", + null, + "9", + "\u06f0", + null, "8", null, null, - "\u060c", + "\u06f1", null, + "\u060c", "!text/morekeys_arabic_diacritics", null, - "<|>", - "[|]", - "\u2264|\u2265", - "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", - "\u2039|\u203a", null, - "(|)", - "\u060c", - ")|(", null, - "\u203a|\u2039", - "{|}", null, "\u00ab|\u00bb", - "\u2265|\u2264", - ">|<", - "\u064b", - "?,\u00bf", + "(|)", + null, "\u00bb|\u00ab", + null, + ")|(", + "\u203a|\u2039", "}|{", null, - null, - null, + "<|>", + ">|<", + "\u064b", "]|[", + "\u2265|\u2264", + "\u2039|\u203a", + "\u060c", + "!fixedColumnOrder!4,:,!,\u061f,\u061b,-,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", + null, + null, + "{|}", + "?,\u00bf", + "[|]", + "\u2264|\u2265", "\u2605,\u066d", null, null, null, null, - null, - null, - "\u061f", + "\u266a", "\u061f", null, - "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", - null, - ";", - null, - null, - "\\%,\u2030", - "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", null, "\u064b", - "!fixedColumnOrder!7, \u0655|\u0655, \u0652|\u0652, \u0651|\u0651, \u064c|\u064c, \u064d|\u064d, \u064b|\u064b, \u0654|\u0654, \u0656|\u0656, \u0670|\u0670, \u0653|\u0653, \u064f|\u064f, \u0650|\u0650, \u064e|\u064e,\u0640\u0640\u0640|\u0640", + null, + null, + null, + null, + null, + null, + null, + null, "\u061b", null, null, null, + "!fixedColumnOrder!4,\ufd3f|\ufd3e,!text/keyspecs_right_parenthesis_more_keys", + "!fixedColumnOrder!7, \u0655|\u0655, \u0652|\u0652, \u0651|\u0651, \u064c|\u064c, \u064d|\u064d, \u064b|\u064b, \u0654|\u0654, \u0656|\u0656, \u0670|\u0670, \u0653|\u0653, \u064f|\u064f, \u0650|\u0650, \u064e|\u064e,\u0640\u0640\u0640|\u0640", + "\u061f", "\u066a", null, null, null, + ";", + "\\%,\u2030", null, null, null, + "!fixedColumnOrder!4,\ufd3e|\ufd3f,!text/keyspecs_left_parenthesis_more_keys", null, - "\u266a", + "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than", null, null, null, null, null, - "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than", null, null, - null, - null, - "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than" + "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than" }; private static final String[] TEXTS_fi = { @@ -1234,8 +1325,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u0161,\u00df,\u015b", null, + "\u0161,\u00df,\u015b", null, null, "\u017e,\u017a,\u017c", @@ -1252,30 +1343,34 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f8", - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u00f6", - null, - null, - null, - null, null, null, null, null, "\u00e5", null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00e4", null, null, + "\u00f6", + null, + "\u00f8", + null, null, null, null, @@ -1347,30 +1442,30 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, "\u00f6", null, - null, - null, "\u00e9", null, null, - "\u00fc", - null, - null, - null, - null, - null, - null, null, "\u00e0", null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00e8", null, null, - "\u00e4" + null, + null, + null, + "\u00e4", + "\u00fc" }; private static final String[] TEXTS_gl = { @@ -1473,18 +1568,8 @@ public final class KeyboardTextsTable { null, null, null, - "Next", - null, - "Prev", - "Search", - "Pause", - null, - null, - null, - null, - null, - null, null, + "Wait", null, null, null, @@ -1493,17 +1578,24 @@ public final class KeyboardTextsTable { null, null, "Send", - null, "Go", + "Next", null, null, null, - "Wait", + null, + "Pause", + null, + "Search", null, null, null, null, null, + null, + "Prev", + null, + null, "Done" }; @@ -1531,43 +1623,41 @@ public final class KeyboardTextsTable { null, null, null, - "\u096f", - null, - "0", - "4", - null, - null, - "\u096e", - "\u0966", - "5", - "1", - "!autoColumnOrder!8,\\,.,',#,),(,/,;,@,:,-,\\\",+,\\%,&", "\u096c", - "?\u0967\u0968\u0969", - "\u0969", - "\u0967", - null, - "\u096d", - "\u096a", - "9", + "5", "6", - "3", - null, + "2", + "!autoColumnOrder!8,\\,.,',#,),(,/,;,@,:,-,\\\",+,\\%,&", + "1", + "4", null, "7", null, - "2", - null, "\u0968", + "3", null, + "0", + "?\u0967\u0968\u0969", "\u096b", null, + "\u096f", + "\u096d", + "\u096a", + null, + "\u0969", + "\u096e", + null, + "9", + "\u0966", + null, "8", null, null, + "\u0967", + null, null, - "\u0964", "!autoColumnOrder!9,\\,.,?,!,#,),(,/,;,',@,:,-,\\\",+,\\%,&", + "\u0964", "\u0964" }; @@ -1582,16 +1672,14 @@ public final class KeyboardTextsTable { "\u010d,\u0107,\u00e7", "\u00f1,\u0144", "!text/double_9qm_rqm", - "\u0161,\u015b,\u00df", "!text/single_9qm_rqm", + "\u0161,\u015b,\u00df", null, null, "\u017e,\u017a,\u017c", "\u0111", - "!text/double_raqm_laqm", - null, - null, - "!text/single_raqm_laqm" + "!text/single_raqm_laqm", + "!text/double_raqm_laqm" }; private static final String[] TEXTS_hu = { @@ -1605,16 +1693,14 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_rqm", - null, "!text/single_9qm_rqm", null, null, null, null, - "!text/double_raqm_laqm", null, - null, - "!text/single_raqm_laqm" + "!text/single_raqm_laqm", + "!text/double_raqm_laqm" }; private static final String[] TEXTS_hy = { @@ -1645,12 +1731,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, "!text/morekeys_punctuation", null, null, @@ -1673,12 +1753,26 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, + "\u055d", + null, + "\u0589", + "\u0589", "!autoColumnOrder!8,\\,\u055e,\u055c,.,\u055a,\u0559,?,!,\u055d,\u055b,\u058a,\u00bb,\u00ab,\u055f,;,:", null, - "\u055d", - "\u0589", null, - "\u0589", + null, + null, + null, + null, + null, + null, + null, null, null, null, @@ -1691,11 +1785,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, "\u055e,\u00bf", null, null, @@ -1739,6 +1828,14 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, + null, + null, "\u055c,\u00a1" }; @@ -1753,9 +1850,9 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", null, + null, "\u00fd,\u00ff", null, "\u00f0", @@ -1830,30 +1927,30 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, "\u00e9", null, - null, - null, "\u00f6", null, null, - "\u00e8", - null, - null, - null, - null, - null, - null, null, "\u00e4", null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00fc", null, null, - "\u00e0" + null, + null, + null, + "\u00e0", + "\u00e8" }; private static final String[] TEXTS_iw = { @@ -1867,8 +1964,8 @@ public final class KeyboardTextsTable { null, null, "!text/double_rqm_9qm", - null, "!text/single_rqm_9qm", + null, "\u20aa", null, null, @@ -1918,35 +2015,33 @@ public final class KeyboardTextsTable { null, null, null, - "<|>", - "[|]", - "\u2264|\u2265", - null, - "\u2039|\u203a", - null, + "\u00ab|\u00bb", "(|)", null, - ")|(", - null, - "\u203a|\u2039", - "{|}", - null, - "\u00ab|\u00bb", - "\u2265|\u2264", - ">|<", - null, - null, "\u00bb|\u00ab", + null, + ")|(", + "\u203a|\u2039", "}|{", null, - null, + "<|>", + ">|<", null, "]|[", - "\u2605", + "\u2265|\u2264", + "\u2039|\u203a", null, null, null, null, + "{|}", + null, + "[|]", + "\u2264|\u2265", + "\u2605", + null, + null, + null, null, null, null, @@ -1997,7 +2092,6 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm" }; @@ -2026,36 +2120,34 @@ public final class KeyboardTextsTable { null, "\u0451", null, - "\u044a", + null, + null, + null, + null, + null, + null, + "\u0449", + null, + null, + null, + null, + "\u044d", + null, null, null, "\u044b", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0438", null, null, null, null, null, - "\u044d", null, - "\u0449", + null, + "\u044a", null, null, null, @@ -2090,22 +2182,18 @@ public final class KeyboardTextsTable { null, null, null, - "\u04e9", - null, - null, - null, - null, - null, - null, - null, - null, - null, null, "\u04af,\u04b1", null, null, null, null, + "\u04e9", + null, + "\u0493", + null, + null, + null, null, null, null, @@ -2117,16 +2205,21 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, + null, + null, + null, + null, + null, + null, "\u04a3", - "\u0493", null, null, null, null, null, - "\u04d9", - null, - null, + "\u04bb", null, null, null, @@ -2134,7 +2227,10 @@ public final class KeyboardTextsTable { null, "\u049b", null, - "\u04bb" + null, + null, + null, + "\u04d9" }; private static final String[] TEXTS_km = { @@ -2264,9 +2360,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, "\u17db,\u00a2,\u00a3,\u20ac,\u00a5,\u20b1" }; @@ -2311,36 +2404,34 @@ public final class KeyboardTextsTable { null, "\u0451", null, - "\u044a", + null, + null, + null, + null, + null, + null, + "\u0449", + null, + null, + null, + null, + "\u044d", + null, null, null, "\u044b", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0438", null, null, null, null, null, - "\u044d", null, - "\u0449", + null, + "\u044a", null, null, null, @@ -2375,6 +2466,12 @@ public final class KeyboardTextsTable { null, null, null, + null, + "\u04af", + null, + null, + null, + null, "\u04e9", null, null, @@ -2386,8 +2483,6 @@ public final class KeyboardTextsTable { null, null, null, - "\u04af", - null, null, null, null, @@ -2432,8 +2527,8 @@ public final class KeyboardTextsTable { "\u010d", null, "\u201d,\u201e,\u201c", - "\u0161", "\u2019,\u201a,\u2018", + "\u0161", null, null, "\u017e" @@ -2450,16 +2545,16 @@ public final class KeyboardTextsTable { "\u010d,\u00e7,\u0107", "\u0146,\u00f1,\u0144", "!text/double_9qm_lqm", - "\u0161,\u00df,\u015b,\u015f", "!text/single_9qm_lqm", + "\u0161,\u00df,\u015b,\u015f", null, "\u00fd,\u00ff", "\u017e,\u017c,\u017a", "\u010f", null, - "\u013c,\u0142,\u013a,\u013e", - "\u0123,\u011f", null, + "\u0123,\u011f", + "\u013c,\u0142,\u013a,\u013e", "\u0163,\u0165", "\u0157,\u0159,\u0155", null, @@ -2484,6 +2579,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u0137" }; @@ -2498,7 +2595,6 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", null, null, @@ -2510,6 +2606,7 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u0450", null, null, @@ -2582,7 +2679,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u0453", + null, + null, null, null, null, @@ -2591,17 +2689,19 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, "\u0437", - "\u045d", null, - "\u0455" + null, + null, + null, + null, + "\u045d", + "\u0455", + null, + null, + null, + null, + "\u0453" }; private static final String[] TEXTS_ml = { @@ -2660,38 +2760,37 @@ public final class KeyboardTextsTable { null, null, null, - "\u096f", - null, - "0", - "4", - null, - null, - "\u096e", - "\u0966", - "5", - "1", - null, "\u096c", - "?\u0967\u0968\u0969", - "\u0969", - "\u0967", - null, - "\u096d", - "\u096a", - "9", + "5", "6", - "3", + "2", null, + "1", + "4", null, "7", null, - "2", - null, "\u0968", + "3", null, + "0", + "?\u0967\u0968\u0969", "\u096b", null, - "8" + "\u096f", + "\u096d", + "\u096a", + null, + "\u0969", + "\u096e", + null, + "9", + "\u0966", + null, + "8", + null, + null, + "\u0967" }; private static final String[] TEXTS_my = { @@ -2750,12 +2849,25 @@ public final class KeyboardTextsTable { null, null, null, + "\u104a", + null, + "\u104b", + "\u104b", "!autoColumnOrder!9,\u104a,.,?,!,#,),(,/,;,...,',@,:,-,\\\",+,\\%,&", null, - "\u104a", - "\u104b", null, - "\u104b", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "\u104a", + null, null, null, null, @@ -2772,21 +2884,6 @@ public final class KeyboardTextsTable { null, null, null, - "\u104a", - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, null, null, null, @@ -2811,7 +2908,6 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_rqm", - null, "!text/single_9qm_rqm", null, null, @@ -2829,20 +2925,6 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f6", - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u00f8", - null, - null, - null, null, null, null, @@ -2850,9 +2932,28 @@ public final class KeyboardTextsTable { null, "\u00e5", null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00e6", null, null, + "\u00f8", + null, + "\u00f6", + null, null, null, null, @@ -2884,43 +2985,41 @@ public final class KeyboardTextsTable { null, null, null, - "\u096f", - null, - "0", - "4", - null, - null, - "\u096e", - "\u0966", - "5", - "1", - "!autoColumnOrder!8,.,\\,',#,),(,/,;,@,:,-,\\\",+,\\%,&", "\u096c", - "?\u0967\u0968\u0969", - "\u0969", - "\u0967", - null, - "\u096d", - "\u096a", - "9", + "5", "6", - "3", - null, + "2", + "!autoColumnOrder!8,.,\\,',#,),(,/,;,@,:,-,\\\",+,\\%,&", + "1", + "4", null, "7", null, - "2", - null, "\u0968", + "3", null, + "0", + "?\u0967\u0968\u0969", "\u096b", null, + "\u096f", + "\u096d", + "\u096a", + null, + "\u0969", + "\u096e", + null, + "9", + "\u0966", + null, "8", null, null, + "\u0967", + null, null, - "\u0964", "!autoColumnOrder!9,.,\\,?,!,#,),(,/,;,',@,:,-,\\\",+,\\%,&", + "\u0964", "\u0964" }; @@ -2935,9 +3034,9 @@ public final class KeyboardTextsTable { null, "\u00f1,\u0144", "!text/double_9qm_rqm", - null, "!text/single_9qm_rqm", null, + null, "\u0133" }; @@ -2952,13 +3051,15 @@ public final class KeyboardTextsTable { "\u0107,\u00e7,\u010d", "\u0144,\u00f1", "!text/double_9qm_rqm", - "\u015b,\u00df,\u0161", "!text/single_9qm_rqm", + "\u015b,\u00df,\u0161", null, null, "\u017c,\u017a,\u017e", null, null, + null, + null, "\u0142" }; @@ -3041,10 +3142,6 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, "\u00e7" }; @@ -3065,8 +3162,8 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_rqm", - "\u0219,\u00df,\u015b,\u0161", "!text/single_9qm_rqm", + "\u0219,\u00df,\u015b,\u0161", null, null, null, @@ -3089,7 +3186,6 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", null, null, @@ -3101,38 +3197,37 @@ public final class KeyboardTextsTable { null, null, null, + null, "\u0451", null, - "\u044a", + null, + null, + null, + null, + null, + null, + "\u0449", + null, + null, + null, + null, + "\u044d", + null, null, null, "\u044b", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0438", null, null, null, null, null, - "\u044d", null, - "\u0449" + null, + "\u044a" }; private static final String[] TEXTS_si = { @@ -3162,16 +3257,16 @@ public final class KeyboardTextsTable { "\u010d,\u00e7,\u0107", "\u0148,\u0146,\u00f1,\u0144", "!text/double_9qm_lqm", - "\u0161,\u00df,\u015b,\u015f", "!text/single_9qm_lqm", + "\u0161,\u00df,\u015b,\u015f", null, "\u00fd,\u00ff", "\u017e,\u017c,\u017a", "\u010f", - "!text/double_raqm_laqm", - "\u013e,\u013a,\u013c,\u0142", - "\u0123,\u011f", "!text/single_raqm_laqm", + "!text/double_raqm_laqm", + "\u0123,\u011f", + "\u013e,\u013a,\u013c,\u0142", "\u0165,\u0163", "\u0155,\u0159,\u0157", null, @@ -3196,6 +3291,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u0137" }; @@ -3210,16 +3307,14 @@ public final class KeyboardTextsTable { "\u010d,\u0107", null, "!text/double_9qm_lqm", - "\u0161", "!text/single_9qm_lqm", + "\u0161", null, null, "\u017e", "\u0111", - "!text/double_raqm_laqm", - null, - null, - "!text/single_raqm_laqm" + "!text/single_raqm_laqm", + "!text/double_raqm_laqm" }; private static final String[] TEXTS_sr_ZZ = { @@ -3233,8 +3328,8 @@ public final class KeyboardTextsTable { "\u010d,\u0107,%", null, null, - "\u0161,%", null, + "\u0161,%", null, null, "\u017e,%", @@ -3310,18 +3405,8 @@ public final class KeyboardTextsTable { null, null, null, - "Sled", - null, - "Preth", - "Tra\u017ei", - "Pauza", - null, - null, - null, - null, - null, - null, null, + "\u010cekaj", null, null, null, @@ -3330,17 +3415,24 @@ public final class KeyboardTextsTable { null, null, "\u0160alji", - null, "Idi", + "Sled", null, null, null, - "\u010cekaj", + null, + "Pauza", + null, + "Tra\u017ei", null, null, null, null, null, + null, + "Preth", + null, + null, "Gotov" }; @@ -3355,16 +3447,16 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", null, null, null, null, + null, + "!text/single_raqm_laqm", "!text/double_raqm_laqm", null, null, - "!text/single_raqm_laqm", null, null, "\u0450", @@ -3439,7 +3531,8 @@ public final class KeyboardTextsTable { null, null, null, - "\u0452", + null, + null, null, null, null, @@ -3448,17 +3541,19 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, "\u0455", - "\u045d", null, - "\u0437" + null, + null, + null, + null, + "\u045d", + "\u0437", + null, + null, + null, + null, + "\u0452" }; private static final String[] TEXTS_sv = { @@ -3472,16 +3567,16 @@ public final class KeyboardTextsTable { "\u00e7,\u0107,\u010d", "\u0144,\u00f1,\u0148", null, - "\u015b,\u0161,\u015f,\u00df", null, + "\u015b,\u0161,\u015f,\u00df", null, "\u00fd,\u00ff", "\u017a,\u017e,\u017c", "\u00f0,\u010f", - "!text/double_raqm_laqm", - "\u0142", - null, "!text/single_raqm_laqm", + "!text/double_raqm_laqm", + null, + "\u0142", "\u0165,\u00fe", "\u0159", null, @@ -3490,30 +3585,34 @@ public final class KeyboardTextsTable { null, null, null, - "\u00f8,\u0153", - null, - null, - null, - null, - null, - null, - null, - null, - null, - "\u00f6", - null, - null, - null, - null, null, null, null, null, "\u00e5", null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, "\u00e4", null, null, + "\u00f6", + null, + "\u00f8,\u0153", + null, null, null, null, @@ -3532,8 +3631,8 @@ public final class KeyboardTextsTable { "\u00e7", "\u00f1", null, - "\u00df", null, + "\u00df", null, null, null, @@ -3638,8 +3737,8 @@ public final class KeyboardTextsTable { "\u00e7,\u0107,\u010d", "\u0148,\u00f1", null, - "\u015f,\u00df,\u015b,\u0161", null, + "\u015f,\u00df,\u015b,\u0161", null, "\u00fd", "\u017e", @@ -3660,8 +3759,8 @@ public final class KeyboardTextsTable { null, null, "!text/double_9qm_lqm", - null, "!text/single_9qm_lqm", + null, "\u20b4", null, null, @@ -3674,36 +3773,34 @@ public final class KeyboardTextsTable { null, null, null, - "\u044a", + null, + null, + null, + null, + null, + null, + "\u0449", + null, + null, + null, + null, + "\u0454", + null, null, null, "\u0456", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0438", null, null, null, null, null, - "\u0454", null, - "\u0449", + null, + "\u044a", null, null, null, @@ -3746,27 +3843,14 @@ public final class KeyboardTextsTable { null, null, null, + "\u0491", null, null, null, null, null, null, - null, - null, - null, - null, - null, - "\u0457", - null, - null, - null, - null, - null, - null, - null, - null, - "\u0491" + "\u0457" }; private static final String[] TEXTS_uz = { @@ -3780,8 +3864,8 @@ public final class KeyboardTextsTable { "\u00e7,\u0107,\u010d", "\u0148,\u00f1", null, - "\u015f,\u00df,\u015b,\u0161", null, + "\u015f,\u00df,\u015b,\u0161", null, "\u00fd", "\u017e", @@ -3821,6 +3905,7 @@ public final class KeyboardTextsTable { "\u00e7", "\u00f1", null, + null, "\u00df" }; @@ -3835,16 +3920,16 @@ public final class KeyboardTextsTable { "\u00e7,\u0107,\u0109,\u010b,\u010d", "\u00f1,\u0144,\u0146,\u0148,\u0149,\u014b", null, - "\u00df,\u015b,\u015d,\u015f,\u0161,\u017f", null, + "\u00df,\u015b,\u015d,\u015f,\u0161,\u017f", null, "\u00fd,\u0177,\u00ff,\u0133", "\u017a,\u017c,\u017e", "\u010f,\u0111,\u00f0", null, - "\u013a,\u013c,\u013e,\u0140,\u0142", - "\u011d,\u011f,\u0121,\u0123", null, + "\u011d,\u011f,\u0121,\u0123", + "\u013a,\u013c,\u013e,\u0140,\u0142", "\u00fe,\u0163,\u0165,\u0167", "\u0155,\u0157,\u0159", null, @@ -3869,6 +3954,8 @@ public final class KeyboardTextsTable { null, null, null, + null, + null, "\u0137,\u0138", null, null, @@ -3914,31 +4001,10 @@ public final class KeyboardTextsTable { null, null, null, - null, - null, - null, - null, - null, - null, - null, "\u0175", null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, "\u0125", null, null, @@ -3958,6 +4024,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, + null, "\u0135" }; @@ -3972,41 +4057,24 @@ public final class KeyboardTextsTable { EMPTY, EMPTY, "!text/double_lqm_rqm", - EMPTY, "!text/single_lqm_rqm", + EMPTY, "$", EMPTY, EMPTY, EMPTY, + "!text/single_laqm_raqm", "!text/double_laqm_raqm", EMPTY, EMPTY, - "!text/single_laqm_raqm", EMPTY, EMPTY, EMPTY, - "9", + "6", EMPTY, EMPTY, EMPTY, - EMPTY, - EMPTY, - "8", - "0", - EMPTY, - EMPTY, "!text/morekeys_tablet_punctuation", - "6", - "?123", - "3", - "1", - EMPTY, - "7", - "4", - EMPTY, - EMPTY, - EMPTY, - EMPTY, EMPTY, EMPTY, EMPTY, @@ -4014,131 +4082,242 @@ public final class KeyboardTextsTable { EMPTY, "2", EMPTY, + EMPTY, + EMPTY, + "?123", "5", EMPTY, + "9", + "7", + "4", EMPTY, - "?,!,\u203d,\u2026,_,\\\\,|,=", + "3", + "8", + EMPTY, + EMPTY, + "0", + EMPTY, + EMPTY, + EMPTY, + EMPTY, + "1", EMPTY, ",", - ".", "!text/morekeys_punctuation", ".", - "<", - "[", - "\u2264", - EMPTY, - "\u2039", - EMPTY, - "(", - ",", - ")", - EMPTY, - "\u203a", - "{", + ".", + "/,?,!,\u203d,\u2026,_,\\\\,|,=", EMPTY, "\u00ab", - "\u2265", + "(", + EMPTY, + "\u00bb", + EMPTY, + ")", + "\u203a", + "}", + EMPTY, + "<", ">", EMPTY, - "\u00bf", - "\u00bb", - "}", + "]", + "\u2265", + "\u2039", + ",", EMPTY, "\u00f1", EMPTY, - "]", + "{", + "\u00bf", + "[", + "\u2264", "\u2020,\u2021,\u2605", EMPTY, - "!string/label_next_key", - EMPTY, - "!string/label_previous_key", - "!string/label_search_key", - "!string/label_pause_key", - "?", - EMPTY, - EMPTY, - "!fixedColumnOrder!3,!text/keyspecs_right_parenthesis_more_keys", - EMPTY, - EMPTY, - EMPTY, - EMPTY, - "\u2030", - "!fixedColumnOrder!3,!text/keyspecs_left_parenthesis_more_keys", - "?,!,\u203d,\u2026,_,\\\\,|,=", - EMPTY, - EMPTY, - ";", - "!string/label_send_key", - EMPTY, - "!string/label_go_key", - "%", EMPTY, EMPTY, "!string/label_wait_key", - EMPTY, - EMPTY, - EMPTY, - EMPTY, "\u266a,\u2665,\u2660,\u2666,\u2663", - "!string/label_done_key", - "x", - "w", - "\u00a1,\u203d", EMPTY, - "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_left_double_angle_quote", + EMPTY, + EMPTY, + EMPTY, + EMPTY, + EMPTY, + "!string/label_send_key", + "!string/label_go_key", + "!string/label_next_key", + EMPTY, + "/,?,!,\u203d,\u2026,_,\\\\,|,=", + EMPTY, + ";", + "!string/label_pause_key", + EMPTY, + "!string/label_search_key", + "!fixedColumnOrder!3,!text/keyspecs_right_parenthesis_more_keys", + EMPTY, + "?", + "%", + EMPTY, + EMPTY, + "!string/label_previous_key", + EMPTY, + "\u2030", + "!string/label_done_key", + EMPTY, + EMPTY, + "!fixedColumnOrder!3,!text/keyspecs_left_parenthesis_more_keys", + EMPTY, + "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_right_double_angle_quote", + "q", "y", EMPTY, "\u00b1", - "q", - "!fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_right_double_angle_quote", + EMPTY, "\u00a2,\u00a3,\u20ac,\u00a5,\u20b1", + "w", + "!fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_left_double_angle_quote", + EMPTY, + "x", + EMPTY, + "\u00a1,\u203d", EMPTY, EMPTY, + "!fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm", EMPTY, EMPTY, - EMPTY, - "\u2018,\u201a,\u2019", - "\u201a,\u2018,\u2019", - "\u201e,\u201c,\u201d", - "!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", - "= \\\\ <", - "PM", - "!text/keyspec_less_than,!text/keyspec_left_curly_bracket,!text/keyspec_left_square_bracket", + "!icon/action_redo|!code/action_redo", "\u2074", - "\u201d,\u201e,\u201c", "123", - "!text/keyspec_left_single_angle_quote,!text/keyspec_right_single_angle_quote", - "\u215d", - "\uff0a\uff03", - "!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes", - "!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes", - "!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/settings_key|!code/key_settings", - "!icon/shortcut_key|!code/key_shortcut", - "\u201c,\u201e,\u201d", - "\u2018,\u2019,\u201a", - "!text/keyspec_right_double_angle_quote,!text/keyspec_left_double_angle_quote", - "AM", - "\u215e", + "&,|", + "@", + "!icon/action_copy|!code/action_copy", + "\\%", EMPTY, - "!hasLabels!,!text/label_next_key|!code/key_action_next", - "!hasLabels!,.net,.org,.gov,.edu", - "\u00b3,\u00be,\u215c", - "\u207f,\u2205", - "\u00b9,\u00bd,\u2153,\u00bc,\u215b", - "~ [ <", "\u2019,\u201a,\u2018", EMPTY, - ".com", - "!text/keyspec_right_single_angle_quote,!text/keyspec_left_single_angle_quote", + "!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes", + "\u201c,\u201e,\u201d", + "1", + "]", + "&", + "),],},>", + "!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", + "8", + "!text/keyspec_less_than,!text/keyspec_left_curly_bracket,!text/keyspec_left_square_bracket", + "\u00fa,\u00fb,\u00fc,\u00f9,\u016b", + "!hasLabels!,!text/label_next_key|!code/key_action_next", + "!hasLabels!,!text/label_previous_key|!code/key_action_previous", + EMPTY, + "^", + "?,/", + EMPTY, + "\u201d,\u201e,\u201c", + EMPTY, + EMPTY, + EMPTY, + EMPTY, + EMPTY, + EMPTY, + EMPTY, + "!text/keyspec_right_double_angle_quote,!text/keyspec_left_double_angle_quote", "\u00b2,\u2154", + "\u00f1", + "\u00e9,\u00e8,\u00ea,\u00eb,\u0113", + "+,=", + EMPTY, + "6", + EMPTY, + "!hasLabels!,.net,.org,.gov,.edu", + "\u201a,\u2018,\u2019", + "0", + "\u215d", + EMPTY, + "|", + "!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes", + "\u2018,\u201a,\u2019", + EMPTY, + "!icon/action_cut|!code/action_cut", + "!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes", + ")", + "!text/keyspec_left_single_angle_quote,!text/keyspec_right_single_angle_quote", + "!icon/settings_key|!code/key_settings", + "}", + "AM", + "[", + "!icon/action_undo|!code/action_undo", + "5", + "*", + "@", + "#", + "!", + "{", + "=", + ";", + EMPTY, + "= \\\\ <", + "%", + "<", + "!text/keyspec_right_single_angle_quote,!text/keyspec_left_single_angle_quote", + "\u00e0,\u00e1,\u00e2,\u00e4,\u00e6,\u00e3,\u00e5,\u0101", + "\u00df", + "'", + "\u201e,\u201c,\u201d", + ">", + EMPTY, + "\u2018,\u2019,\u201a", + EMPTY, + "$,\u20ac,\u00a3,\u00a5,\u00a2", + "7", + "2", + "\u00e7", + "PM", + "(,[,{,<", + "\\%", + EMPTY, + EMPTY, + ":", + "4", + "\u201c,\u201d,\u201e", + EMPTY, + "\u00b9,\u00bd,\u2153,\u00bc,\u215b", + EMPTY, + "\u00b3,\u00be,\u215c", + "(", + "*", + "!icon/shortcut_key|!code/key_shortcut", + "-,\u2013,\u2014,_", + "\u207f,\u2205", + EMPTY, + "3", + "!", + EMPTY, + EMPTY, + EMPTY, + "9", + ".com", + "\u00ed,\u00ee,\u00ef,\u012b,\u00ec", + "!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", + "!icon/action_select_all|!code/action_select_all", + EMPTY, + EMPTY, + "\u00f3,\u00f4,\u00f6,\u00f2,\u0153,\u00f8,\u014d,\u00f5", + "$,\u00a2,\u20ac,\u00a3,\u00a5,\u20b1", + "\u215e", + "$", + EMPTY, + "~ [ <", "!text/keyspec_greater_than,!text/keyspec_right_curly_bracket,!text/keyspec_right_square_bracket", EMPTY, - "$,\u00a2,\u20ac,\u00a3,\u00a5,\u20b1", - "!hasLabels!,!text/label_previous_key|!code/key_action_previous", - "!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes", - "!fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm", - "\u201c,\u201d,\u201e" + EMPTY, + "!icon/action_paste|!code/action_paste", + "\"", + EMPTY, + "#", + "\uff0a\uff03", + EMPTY, + "\\\\", + EMPTY, + EMPTY }; diff --git a/java/src/org/futo/inputmethod/latin/settings/LongPressKeySettings.kt b/java/src/org/futo/inputmethod/latin/settings/LongPressKeySettings.kt new file mode 100644 index 000000000..db61f1ba2 --- /dev/null +++ b/java/src/org/futo/inputmethod/latin/settings/LongPressKeySettings.kt @@ -0,0 +1,104 @@ +package org.futo.inputmethod.latin.settings + +import android.content.Context +import androidx.datastore.preferences.core.stringPreferencesKey +import org.futo.inputmethod.keyboard.internal.MoreKeySpec +import org.futo.inputmethod.latin.uix.SettingsKey +import org.futo.inputmethod.latin.uix.getSettingBlocking + +enum class LongPressKey { + Numbers, + LanguageKeys, + Symbols, + QuickActions, + MiscLetters +} + +fun LongPressKey.name(context: Context): String { + return when(this) { + LongPressKey.Numbers -> "Numbers" + LongPressKey.LanguageKeys -> "Language keys" + LongPressKey.Symbols -> "Symbols" + LongPressKey.QuickActions -> "Quick actions" + LongPressKey.MiscLetters -> "Misc. letters from common languages" + } +} +fun LongPressKey.description(context: Context): String { + return when(this) { + LongPressKey.Numbers -> "e.g. [1] on [q]" + LongPressKey.LanguageKeys -> "e.g. [á] on [a] in Spanish" + LongPressKey.Symbols -> "e.g. [@] on [a]" + LongPressKey.QuickActions -> "e.g. [Copy] on [c]" + LongPressKey.MiscLetters -> "e.g. [ß] on [s] in all Latin script languages" + } +} + +private fun getKind(moreKey: String): LongPressKey? { + val moreKeyStripped = moreKey.replace("!text/", "") + + return if(moreKeyStripped.startsWith("morekeys_misc_")) { + LongPressKey.MiscLetters + } else if(moreKeyStripped.startsWith("actions_")) { + LongPressKey.QuickActions + } else if(moreKeyStripped.startsWith("qwertysyms_")) { + LongPressKey.Symbols + } else if(moreKeyStripped.startsWith("number_")) { + LongPressKey.Numbers + } else if(moreKeyStripped.startsWith("morekeys_")) { + LongPressKey.LanguageKeys + } else { + null + } +} + +val LongPressKeyLayoutSetting = SettingsKey( + stringPreferencesKey("longPressKeyOrdering"), + "${LongPressKey.Numbers.ordinal},${LongPressKey.LanguageKeys.ordinal},${LongPressKey.Symbols.ordinal},${LongPressKey.QuickActions.ordinal},${LongPressKey.MiscLetters.ordinal}" +) + +fun String.toLongPressKeyLayoutItems(): List { + return this.split(",").mapNotNull { + val id = it.toIntOrNull() ?: return@mapNotNull null + + LongPressKey.entries[id] + } +} + +fun List.toEncodedString(): String { + return this.joinToString(separator = ",") { + "${it.ordinal}" + } +} + +class LongPressKeySettings(val context: Context) { + private val currentSetting = context.getSettingBlocking(LongPressKeyLayoutSetting).toLongPressKeyLayoutItems() + + fun reorderMoreKeys(moreKeys: String): String { + val keys = MoreKeySpec.splitKeySpecs(moreKeys)?.toList() ?: listOf(moreKeys) + + val finalKeys = mutableListOf() + + // Add non configurable keys first + keys.forEach { key -> + if(getKind(key) == null) { + finalKeys.add(key) + } + } + + // Add the necessary configurable keys in the correct order. + // Key kinds not enabled are not added + currentSetting.forEach { kind -> + keys.forEach { key -> + if(getKind(key) == kind) { + finalKeys.add(key) + } + } + } + + return finalKeys.joinToString(separator = ",") + } + + override operator fun equals(other: Any?): Boolean { + return other is LongPressKeySettings && (other.currentSetting.joinToString(",") == currentSetting.joinToString(",")) + } +} \ No newline at end of file diff --git a/java/src/org/futo/inputmethod/latin/uix/TextEditPopupActivity.kt b/java/src/org/futo/inputmethod/latin/uix/TextEditPopupActivity.kt index b9af94da5..028131ec5 100644 --- a/java/src/org/futo/inputmethod/latin/uix/TextEditPopupActivity.kt +++ b/java/src/org/futo/inputmethod/latin/uix/TextEditPopupActivity.kt @@ -22,7 +22,7 @@ import androidx.compose.ui.viewinterop.AndroidView import org.futo.inputmethod.latin.R @Composable -fun AndroidTextInput() { +fun AndroidTextInput(allowPredictions: Boolean = true) { val context = LocalContext.current val bgColor = MaterialTheme.colorScheme.background val fgColor = MaterialTheme.colorScheme.onBackground @@ -30,9 +30,14 @@ fun AndroidTextInput() { if(!LocalInspectionMode.current) { val editText = remember { EditText(context).apply { - inputType = EditorInfo.TYPE_CLASS_TEXT - isSingleLine = false - this. + if(allowPredictions) { + inputType = EditorInfo.TYPE_CLASS_TEXT + isSingleLine = false + } else { + inputType = EditorInfo.TYPE_CLASS_TEXT or EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE + isSingleLine = true + } + setHint(R.string.try_typing) setBackgroundColor(bgColor.toArgb()) diff --git a/java/src/org/futo/inputmethod/latin/uix/UixManager.kt b/java/src/org/futo/inputmethod/latin/uix/UixManager.kt index f3b6e2a66..8a82caeba 100644 --- a/java/src/org/futo/inputmethod/latin/uix/UixManager.kt +++ b/java/src/org/futo/inputmethod/latin/uix/UixManager.kt @@ -327,7 +327,7 @@ class UixManager(private val latinIME: LatinIME) { persistentStates[action] = action.persistentState?.let { it(keyboardManagerForAction) } } - currWindowActionWindow = action.windowImpl?.let { it(keyboardManagerForAction, persistentStates[action]) } + currWindowActionWindow = (action.windowImpl!!)(keyboardManagerForAction, persistentStates[action]) if(action.keepScreenAwake) { latinIME.window.window?.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/Components.kt b/java/src/org/futo/inputmethod/latin/uix/settings/Components.kt index d4a73c1c9..c4a3c8507 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/Components.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/Components.kt @@ -465,11 +465,11 @@ fun SettingSliderSharedPrefsInt( } @Composable -fun ScrollableList(content: @Composable () -> Unit) { +fun ScrollableList(modifier: Modifier = Modifier, content: @Composable () -> Unit) { val scrollState = rememberScrollState() Column( - modifier = Modifier + modifier = modifier .fillMaxSize() .verticalScroll(scrollState) ) { diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/SettingsActivity.kt b/java/src/org/futo/inputmethod/latin/uix/settings/SettingsActivity.kt index fdd42b469..d13d1a415 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/SettingsActivity.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/SettingsActivity.kt @@ -30,11 +30,15 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking +import org.futo.inputmethod.latin.uix.BasicThemeProvider +import org.futo.inputmethod.latin.uix.DynamicThemeProvider +import org.futo.inputmethod.latin.uix.DynamicThemeProviderOwner import org.futo.inputmethod.latin.uix.ImportResourceActivity import org.futo.inputmethod.latin.uix.THEME_KEY import org.futo.inputmethod.latin.uix.USE_SYSTEM_VOICE_INPUT import org.futo.inputmethod.latin.uix.deferGetSetting import org.futo.inputmethod.latin.uix.getSetting +import org.futo.inputmethod.latin.uix.getSettingFlow import org.futo.inputmethod.latin.uix.theme.StatusBarColorSetter import org.futo.inputmethod.latin.uix.theme.ThemeOption import org.futo.inputmethod.latin.uix.theme.ThemeOptions @@ -76,7 +80,7 @@ public const val IMPORT_GGUF_MODEL_REQUEST = 71067309 public const val EXPORT_GGUF_MODEL_REQUEST = 80595439 -class SettingsActivity : ComponentActivity() { +class SettingsActivity : ComponentActivity(), DynamicThemeProviderOwner { private val themeOption: MutableState = mutableStateOf(null) private val inputMethodEnabled = mutableStateOf(false) @@ -181,6 +185,23 @@ class SettingsActivity : ComponentActivity() { checkForUpdateAndSaveToPreferences(applicationContext) } + lifecycleScope.launch { + getSettingFlow(THEME_KEY).collect { + val themeOptionFromSettings = ThemeOptions[it] + val themeOption = when { + themeOptionFromSettings == null -> VoiceInputTheme + !themeOptionFromSettings.available(this@SettingsActivity) -> VoiceInputTheme + else -> themeOptionFromSettings + } + + this@SettingsActivity.themeOption.value = themeOption + this@SettingsActivity.themeProvider = BasicThemeProvider( + context = this@SettingsActivity, + overrideColorScheme = themeOption.obtainColors(this@SettingsActivity) + ) + } + } + deferGetSetting(THEME_KEY) { val themeOptionFromSettings = ThemeOptions[it] val themeOption = when { @@ -252,4 +273,10 @@ class SettingsActivity : ComponentActivity() { } } } + + // Provides theme for keyboard preview + private var themeProvider: BasicThemeProvider? = null + override fun getDrawableProvider(): DynamicThemeProvider { + return themeProvider!! + } } \ No newline at end of file diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/SettingsNavigator.kt b/java/src/org/futo/inputmethod/latin/uix/settings/SettingsNavigator.kt index e406b7ead..32292f6ab 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/SettingsNavigator.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/SettingsNavigator.kt @@ -24,9 +24,9 @@ import org.futo.inputmethod.latin.uix.settings.pages.PaymentScreen import org.futo.inputmethod.latin.uix.settings.pages.PaymentThankYouScreen import org.futo.inputmethod.latin.uix.settings.pages.PredictiveTextScreen import org.futo.inputmethod.latin.uix.settings.pages.ThemeScreen -import org.futo.inputmethod.latin.uix.settings.pages.TypingScreen import org.futo.inputmethod.latin.uix.settings.pages.VoiceInputScreen import org.futo.inputmethod.latin.uix.settings.pages.addModelManagerNavigation +import org.futo.inputmethod.latin.uix.settings.pages.addTypingNavigation import org.futo.inputmethod.latin.uix.urlDecode import org.futo.inputmethod.latin.uix.urlEncode @@ -54,7 +54,7 @@ fun SettingsNavigator( composable("addLanguage") { AddLanguageScreen(navController) } composable("predictiveText") { PredictiveTextScreen(navController) } composable("advancedparams") { AdvancedParametersScreen(navController) } - composable("typing") { TypingScreen(navController) } + addTypingNavigation(navController) composable("voiceInput") { VoiceInputScreen(navController) } composable("themes") { ThemeScreen(navController) } composable("help") { HelpScreen(navController) } diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Home.kt b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Home.kt index 77fd72496..20a1b2753 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Home.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Home.kt @@ -64,32 +64,43 @@ fun HomeScreen(navController: NavHostController = rememberNavController()) { ) NavigationItem( - title = "Predictive Text", + title = "Keyboard & Typing", style = NavigationItemStyle.HomeSecondary, - navigate = { navController.navigate("predictiveText") }, - icon = painterResource(id = R.drawable.shift) + navigate = { navController.navigate("typing") }, + icon = painterResource(id = R.drawable.keyboard) ) NavigationItem( - title = "Typing Preferences", - style = NavigationItemStyle.HomeSecondary, - navigate = { navController.navigate("typing") }, - icon = painterResource(id = R.drawable.delete) + title = "Text Prediction", + style = NavigationItemStyle.HomeTertiary, + navigate = { navController.navigate("predictiveText") }, + icon = painterResource(id = R.drawable.text_prediction) ) NavigationItem( title = "Voice Input", - style = NavigationItemStyle.HomeSecondary, + style = NavigationItemStyle.HomePrimary, subtitle = if(useDataStoreValueBlocking(USE_SYSTEM_VOICE_INPUT)) { "Built-in voice input is disabled!" } else { null }, navigate = { navController.navigate("voiceInput") }, icon = painterResource(id = R.drawable.mic_fill) ) + NavigationItem( + title = stringResource(R.string.edit_personal_dictionary), + style = NavigationItemStyle.HomeSecondary, + icon = painterResource(id = R.drawable.book), + navigate = { + val intent = Intent("android.settings.USER_DICTIONARY_SETTINGS") + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK + context.startActivity(intent) + } + ) + NavigationItem( title = "Theme", style = NavigationItemStyle.HomeTertiary, navigate = { navController.navigate("themes") }, - icon = painterResource(id = R.drawable.eye) + icon = painterResource(id = R.drawable.themes) ) if(!isPaid) { @@ -103,7 +114,7 @@ fun HomeScreen(navController: NavHostController = rememberNavController()) { NavigationItem( title = "Help & Feedback", - style = NavigationItemStyle.HomePrimary, + style = NavigationItemStyle.HomeSecondary, navigate = { navController.navigate("help") }, icon = painterResource(id = R.drawable.help_circle) ) @@ -111,7 +122,7 @@ fun HomeScreen(navController: NavHostController = rememberNavController()) { if(isDeveloper || LocalInspectionMode.current) { NavigationItem( title = "Developer Settings", - style = NavigationItemStyle.HomeSecondary, + style = NavigationItemStyle.HomeTertiary, navigate = { navController.navigate("developer") }, icon = painterResource(id = R.drawable.code) ) diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt index a882a030a..32e7d2871 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt @@ -1,46 +1,436 @@ package org.futo.inputmethod.latin.uix.settings.pages +import android.content.Context import android.preference.PreferenceManager +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.gestures.detectDragGestures +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.width +import androidx.compose.foundation.lazy.LazyItemScope +import androidx.compose.foundation.lazy.LazyListScope +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Add +import androidx.compose.material.icons.filled.Clear +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material3.Button +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.booleanResource +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import androidx.compose.ui.zIndex import androidx.core.content.edit import androidx.datastore.preferences.core.intPreferencesKey +import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController +import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.futo.inputmethod.latin.R +import org.futo.inputmethod.latin.settings.LongPressKey +import org.futo.inputmethod.latin.settings.LongPressKeyLayoutSetting import org.futo.inputmethod.latin.settings.Settings import org.futo.inputmethod.latin.settings.Settings.PREF_VIBRATION_DURATION_SETTINGS +import org.futo.inputmethod.latin.settings.description +import org.futo.inputmethod.latin.settings.name +import org.futo.inputmethod.latin.settings.toEncodedString +import org.futo.inputmethod.latin.settings.toLongPressKeyLayoutItems +import org.futo.inputmethod.latin.uix.AndroidTextInput +import org.futo.inputmethod.latin.uix.KeyHintsSetting +import org.futo.inputmethod.latin.uix.KeyboardBottomOffsetSetting +import org.futo.inputmethod.latin.uix.KeyboardHeightMultiplierSetting import org.futo.inputmethod.latin.uix.SHOW_EMOJI_SUGGESTIONS import org.futo.inputmethod.latin.uix.SettingsKey import org.futo.inputmethod.latin.uix.actions.AllActions +import org.futo.inputmethod.latin.uix.actions.ClipboardHistoryAction import org.futo.inputmethod.latin.uix.actions.ClipboardHistoryEnabled +import org.futo.inputmethod.latin.uix.actions.CopyAction +import org.futo.inputmethod.latin.uix.actions.CutAction +import org.futo.inputmethod.latin.uix.actions.EmojiAction +import org.futo.inputmethod.latin.uix.actions.PasteAction +import org.futo.inputmethod.latin.uix.actions.RedoAction +import org.futo.inputmethod.latin.uix.actions.SelectAllAction +import org.futo.inputmethod.latin.uix.actions.SwitchLanguageAction +import org.futo.inputmethod.latin.uix.actions.TextEditAction +import org.futo.inputmethod.latin.uix.actions.UndoAction +import org.futo.inputmethod.latin.uix.actions.VoiceInputAction +import org.futo.inputmethod.latin.uix.getSettingBlocking +import org.futo.inputmethod.latin.uix.settings.DataStoreItem import org.futo.inputmethod.latin.uix.settings.DropDownPicker +import org.futo.inputmethod.latin.uix.settings.NavigationItem +import org.futo.inputmethod.latin.uix.settings.NavigationItemStyle import org.futo.inputmethod.latin.uix.settings.ScreenTitle import org.futo.inputmethod.latin.uix.settings.ScrollableList import org.futo.inputmethod.latin.uix.settings.SettingItem +import org.futo.inputmethod.latin.uix.settings.SettingListLazy import org.futo.inputmethod.latin.uix.settings.SettingSlider import org.futo.inputmethod.latin.uix.settings.SettingSliderSharedPrefsInt import org.futo.inputmethod.latin.uix.settings.SettingToggleDataStore import org.futo.inputmethod.latin.uix.settings.SettingToggleSharedPrefs import org.futo.inputmethod.latin.uix.settings.useDataStore +import org.futo.inputmethod.latin.uix.settings.useSharedPrefsBool import org.futo.inputmethod.latin.uix.settings.useSharedPrefsInt +import kotlin.math.absoluteValue import kotlin.math.roundToInt +import kotlin.math.sign val vibrationDurationSetting = SettingsKey( intPreferencesKey("vibration_duration"), -1 ) -@Preview +fun NavGraphBuilder.addTypingNavigation( + navController: NavHostController +) { + composable("typing") { TypingScreen(navController) } + composable("resize") { ResizeScreen(navController) } + composable("longPress") { LongPressScreen(navController) } + composable("actionKey") { ActionKeyScreen(navController) } +} + +@Preview(showBackground = true) +@Composable +fun ResizeScreen(navController: NavHostController = rememberNavController()) { + val context = LocalContext.current + Box { + ScrollableList { + ScreenTitle("Resize Keyboard", showBack = true, navController) + + SettingSlider( + title = "Keyboard Height", + setting = KeyboardHeightMultiplierSetting, + range = 0.33f..1.75f, transform = { it }, + indicator = { "${(it * 100.0f).roundToInt()}%" }, + steps = 16 + ) + SettingSlider( + title = "Keyboard Offset", + setting = KeyboardBottomOffsetSetting, + range = 0.0f..50.0f, + hardRange = 0.0f..250.0f, + transform = { it }, + indicator = { "${String.format("%.1f", it)} dp" }, + steps = 9 + ) + + AndroidTextInput(allowPredictions = false) + } + + /* + AndroidView(factory = { + val ctx = ContextThemeWrapper(context, R.style.KeyboardTheme_LXX_Light) + + val inputView = LayoutInflater.from(ctx).inflate( + R.layout.input_view, null, false + ) as InputView + + val settingsValues = Settings.getInstance().current + + val builder = KeyboardLayoutSet.Builder(ctx, null) + val res: Resources = ctx.resources + + val currentSubtype = RichInputMethodSubtype(Subtypes.getActiveSubtype(ctx)) + + val keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res) + val keyboardHeight = ResourceUtils.getKeyboardHeight(res, settingsValues) + builder.setKeyboardGeometry(keyboardWidth, keyboardHeight) + builder.setSubtype(currentSubtype) + builder.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey) + builder.setBottomActionKey(settingsValues.mShowsActionKey, settingsValues.mActionKeyId) + builder.setSplitLayoutEnabledByUser( + ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED + && settingsValues.mIsSplitKeyboardEnabled + ) + builder.setNumberRow(settingsValues.mIsNumberRowEnabled) + + + val keyboardLayoutSet = builder.build() + + val keyboardView = inputView.findViewById(R.id.keyboard_view) as MainKeyboardView + + keyboardView.setKeyboard(keyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET)) + /* + mMainKeyboardFrame = mCurrentInputView!!.findViewById(R.id.main_keyboard_frame) + mKeyboardView = + mCurrentInputView!!.findViewById(R.id.keyboard_view) as MainKeyboardView + */ + inputView + }, modifier = Modifier.align(Alignment.BottomCenter)) + */ + } +} + +@OptIn(ExperimentalFoundationApi::class) +@Composable +private fun LazyItemScope.DraggableSettingItem(idx: Int, item: LongPressKey, moveItem: (LongPressKey, Int) -> Unit, disable: (LongPressKey) -> Unit, dragIcon: @Composable () -> Unit) { + val context = LocalContext.current + val dragging = remember { mutableStateOf(false) } + val offset = remember { mutableFloatStateOf(0.0f) } + val height = remember { mutableIntStateOf(1) } + + SettingItem( + title = "${idx+1}. " + item.name(context), + subtitle = item.description(context), + icon = dragIcon, + modifier = Modifier + .onSizeChanged { size -> height.intValue = size.height } + .pointerInput(Unit) { + detectDragGestures( + onDragStart = { + dragging.value = true + offset.floatValue = 0.0f + }, + onDragEnd = { + dragging.value = false + offset.floatValue = 0.0f + }, + onDragCancel = { + dragging.value = false + offset.floatValue = 0.0f + }, + onDrag = { change, dragAmount -> + offset.floatValue += dragAmount.y + if (offset.floatValue.absoluteValue > height.intValue) { + val direction = offset.floatValue.sign.toInt() + moveItem( + item, + direction + ) + offset.floatValue -= height.intValue * direction + } + + } + ) + } + .let { modifier -> + if (!dragging.value) { + modifier.animateItemPlacement() + } else { + modifier + .zIndex(10.0f) + .graphicsLayer { + clip = false + translationX = 0.0f + translationY = offset.floatValue + } + } + } + ) { + IconButton(onClick = { disable(item) }) { + Icon(Icons.Default.Clear, contentDescription = "Remove") + } + } +} + +@OptIn(ExperimentalFoundationApi::class) +fun LazyListScope.longPressKeyLayoutEditor(context: Context, setting: DataStoreItem) { + item { + ScreenTitle(title = "Layout of long-press keys") + } + + item { + Button(onClick = { + setting.setValue(LongPressKeyLayoutSetting.default) + }) { + Text("Reset to default") + } + } + + + val dragIcon: @Composable () -> Unit = { + Icon(Icons.Default.Menu, contentDescription = null, tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } + + + val items = setting.value.toLongPressKeyLayoutItems() + + + val moveItem: (item: LongPressKey, direction: Int) -> Unit = { item, direction -> + val oldItems = context.getSettingBlocking(LongPressKeyLayoutSetting).toLongPressKeyLayoutItems() + val oldIdx = oldItems.indexOf(item) + + val insertIdx = (oldIdx + direction).coerceAtLeast(0).coerceAtMost(oldItems.size - 1) + + val newItems = oldItems.filter { it != item }.toMutableList().apply { + add(insertIdx, item) + }.toEncodedString() + + setting.setValue(newItems) + } + + val disable: (item : LongPressKey) -> Unit = { item -> + val oldItems = context.getSettingBlocking(LongPressKeyLayoutSetting).toLongPressKeyLayoutItems() + + val newItems = oldItems.filter { it != item }.toEncodedString() + + setting.setValue(newItems) + + } + + val enable: (item : LongPressKey) -> Unit = { item -> + val oldItems = context.getSettingBlocking(LongPressKeyLayoutSetting).toLongPressKeyLayoutItems() + + val newItems = oldItems.filter { it != item }.toMutableList().apply { + add(item) + }.toEncodedString() + + setting.setValue(newItems) + } + + item { + Text("Active", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center) + } + itemsIndexed(items, key = { i, v -> v.ordinal }) { i, v -> + DraggableSettingItem(idx = i, item = v, moveItem = moveItem, disable = disable, dragIcon = dragIcon) + } + + item { + Text("Inactive", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center) + } + items(LongPressKey.entries.filter { !items.contains(it) }, key = { it.ordinal }) { + SettingItem( + title = it.name(context), + subtitle = it.description(context), + modifier = Modifier.animateItemPlacement() + ) { + IconButton(onClick = { enable(it) }) { + Icon(Icons.Default.Add, contentDescription = "Add") + } + } + } +} + +@Preview(showBackground = true) +@Composable +fun LongPressScreen(navController: NavHostController = rememberNavController()) { + val context = LocalContext.current + val setting = useDataStore(LongPressKeyLayoutSetting, blocking = true) + SettingListLazy { + item { + ScreenTitle("Long-Press Keys", showBack = true, navController) + } + + item { + SettingToggleDataStore( + title = "Show hints", + subtitle = "Display a small hint on each key, showing the primary long-press key", + setting = KeyHintsSetting + ) + } + + /* + SettingToggleDataStore( + title = "Spacebar language switcher", + subtitle = "Show the language switching menu when long-pressing the space", + setting = KeyHintsSetting + )*/ + + longPressKeyLayoutEditor( + context = context, + setting = setting, + ) + + item { + SettingSliderSharedPrefsInt( + title = "Long Press Duration", + subtitle = "How long a key needs to be pressed to be considered a long-press", + key = Settings.PREF_KEY_LONGPRESS_TIMEOUT, + default = 300, + range = 100.0f..700.0f, + hardRange = 25.0f..1200.0f, + transform = { it.roundToInt() }, + indicator = { "$it ms" }, + steps = 23 + ) + } + + /* + SettingRadio( + title = "Spacebar behavior", + options = listOf(0, 1, 2), + optionNames = listOf( + "Swiping moves cursor, long-pressing switches language", + "Swiping changes language, long-pressing moves cursor", + "Swiping and long-pressing only moves cursor" + ), + setting = + )*/ + } +} + +@Preview(showBackground = true) +@Composable +fun ActionKeyScreen(navController: NavHostController = rememberNavController()) { + val context = LocalContext.current + val isActionKeyActive = useSharedPrefsBool(key = Settings.PREF_SHOW_ACTION_KEY, default = true) + val emojiKey = useSharedPrefsInt(key = Settings.PREF_ACTION_KEY_ID, default = 0) + + val permittedOptions = listOf( + EmojiAction, + SwitchLanguageAction, + VoiceInputAction, + ClipboardHistoryAction, + TextEditAction, + UndoAction, + RedoAction, + CutAction, + CopyAction, + PasteAction, + SelectAllAction, + ) + + ScrollableList { + ScreenTitle("Action Key", showBack = true, navController) + + + SettingToggleSharedPrefs( + title = "Action key enabled", + subtitle = "Show the action key on the bottom row", + key = Settings.PREF_SHOW_ACTION_KEY, + default = true + ) + + if(isActionKeyActive.value) { + SettingItem(title = "Action key") { + DropDownPicker( + label = "", + options = permittedOptions, + selection = AllActions[emojiKey.value], + onSet = { + emojiKey.setValue(AllActions.indexOf(it)) + }, + getDisplayName = { + context.getString(it.name) + }, + modifier = Modifier.width(180.dp) + ) + } + } + + } +} + +@Preview(showBackground = true) @Composable fun TypingScreen(navController: NavHostController = rememberNavController()) { val context = LocalContext.current @@ -56,71 +446,103 @@ fun TypingScreen(navController: NavHostController = rememberNavController()) { } ScrollableList { - ScreenTitle("Typing Preferences", showBack = true, navController) + ScreenTitle("Keyboard", showBack = true, navController) + + + NavigationItem( + title = "Resize Keyboard", + subtitle = "Change the height and offset of the keyboard", + style = NavigationItemStyle.Misc, + navigate = { navController.navigate("resize") }, + icon = painterResource(id = R.drawable.maximize) + ) + + SettingToggleSharedPrefs( + title = "Show Number Row", + subtitle = "When active, the number row is shown on top of the keyboard at all times", + key = Settings.PREF_ENABLE_NUMBER_ROW, + default = false, + icon = { Text("123", style = TextBodyRegularMlStyle, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) } + ) + + NavigationItem( + title = "Long-Press Letters & Symbols", + subtitle = "Configure long-press duration and how to order letters/symbols.", + style = NavigationItemStyle.Misc, + navigate = { navController.navigate("longPress") }, + icon = painterResource(id = R.drawable.arrow_up) + ) + + NavigationItem( + title = "Action Key", + subtitle = "Change the action key into an emoji key, language switch key, or disable it altogether.", + style = NavigationItemStyle.Misc, + navigate = { navController.navigate("actionKey") }, + icon = painterResource(id = R.drawable.smile) + ) + + NavigationItem( + title = "Additional Layouts", + subtitle = "Configure additional layouts in the languages screen", + style = NavigationItemStyle.Misc, + navigate = { navController.navigate("languages") }, + icon = painterResource(id = R.drawable.keyboard) + ) + + ScreenTitle(title = "Typing preferences") + + SettingToggleSharedPrefs( + title = "Swipe Typing (alpha)", + subtitle = "Allow swiping from key to key to write words.", + key = Settings.PREF_GESTURE_INPUT, + default = true, + icon = { + Icon(painterResource(id = R.drawable.swipe_icon), contentDescription = null, + tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } + ) SettingToggleDataStore( title = "Emoji Suggestions", subtitle = "Suggest emojis while you're typing", - setting = SHOW_EMOJI_SUGGESTIONS + setting = SHOW_EMOJI_SUGGESTIONS, + icon = { + Icon(painterResource(id = R.drawable.smile), contentDescription = null, + tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } ) SettingToggleSharedPrefs( - title = "Swipe typing", - key = Settings.PREF_GESTURE_INPUT, - default = true + title = stringResource(R.string.auto_correction), + subtitle = stringResource(R.string.auto_correction_summary), + key = Settings.PREF_AUTO_CORRECTION, + default = true, + icon = { + Icon(painterResource(id = R.drawable.icon_spellcheck), contentDescription = null, + tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } ) - SettingToggleSharedPrefs( - title = "Number row", - key = Settings.PREF_ENABLE_NUMBER_ROW, - default = false - ) - - SettingToggleDataStore( - title = "Clipboard History", - setting = ClipboardHistoryEnabled - ) - - SettingToggleSharedPrefs( - title = "Action key enabled", - subtitle = "Show the action key on the bottom row", - key = Settings.PREF_SHOW_ACTION_KEY, - default = true - ) - - val emojiKey = useSharedPrefsInt(key = Settings.PREF_ACTION_KEY_ID, default = 0) - SettingItem(title = "Action key") { - DropDownPicker( - label = "", - options = AllActions, - selection = AllActions[emojiKey.value], - onSet = { - emojiKey.setValue(AllActions.indexOf(it)) - }, - getDisplayName = { - context.getString(it.name) - }, - modifier = Modifier.width(180.dp) - ) - } - SettingToggleSharedPrefs( title = stringResource(R.string.auto_cap), subtitle = stringResource(R.string.auto_cap_summary), key = Settings.PREF_AUTO_CAP, - default = true + default = true, + icon = { + Text("Aa", style = TextBodyRegularMlStyle, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } ) + SettingToggleSharedPrefs( title = stringResource(R.string.use_double_space_period), subtitle = stringResource(R.string.use_double_space_period_summary), key = Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, - default = true - ) - SettingToggleSharedPrefs( - title = stringResource(R.string.vibrate_on_keypress), - key = Settings.PREF_VIBRATE_ON, - default = booleanResource(R.bool.config_default_vibration_enabled) + default = true, + icon = { + Text(".", style = TextBodyRegularMlStyle, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f)) + } ) + SettingToggleSharedPrefs( title = stringResource(R.string.sound_on_keypress), key = Settings.PREF_SOUND_ON, @@ -132,6 +554,12 @@ fun TypingScreen(navController: NavHostController = rememberNavController()) { default = booleanResource(R.bool.config_default_key_preview_popup) ) + SettingToggleSharedPrefs( + title = stringResource(R.string.vibrate_on_keypress), + key = Settings.PREF_VIBRATE_ON, + default = booleanResource(R.bool.config_default_vibration_enabled) + ) + SettingSlider( title = "Vibration", setting = vibrationDurationSetting, @@ -147,15 +575,10 @@ fun TypingScreen(navController: NavHostController = rememberNavController()) { } ) - SettingSliderSharedPrefsInt( - title = "Long Press Duration", - key = Settings.PREF_KEY_LONGPRESS_TIMEOUT, - default = 300, - range = 100.0f .. 700.0f, - hardRange = 25.0f .. 1200.0f, - transform = { it.roundToInt() }, - indicator = { "$it ms" }, - steps = 23 + SettingToggleDataStore( + title = "Clipboard History", + setting = ClipboardHistoryEnabled ) } -} \ No newline at end of file +} + diff --git a/java/src/org/futo/inputmethod/latin/uix/theme/selector/ThemePicker.kt b/java/src/org/futo/inputmethod/latin/uix/theme/selector/ThemePicker.kt index 3bd9d452b..1634fd55d 100644 --- a/java/src/org/futo/inputmethod/latin/uix/theme/selector/ThemePicker.kt +++ b/java/src/org/futo/inputmethod/latin/uix/theme/selector/ThemePicker.kt @@ -282,39 +282,6 @@ fun ThemePicker(onSelected: (ThemeOption) -> Unit) { ) } } - item(span = { GridItemSpan(maxCurrentLineSpan) }) { - CompositionLocalProvider(LocalLayoutDirection provides originalDirection) { - SettingToggleDataStore( - title = "Show symbol hints", - setting = KeyHintsSetting - ) - } - } - - item(span = { GridItemSpan(maxCurrentLineSpan) }) { - CompositionLocalProvider(LocalLayoutDirection provides originalDirection) { - SettingSlider( - title = "Keyboard Height", - setting = KeyboardHeightMultiplierSetting, - range = 0.33f..1.75f, transform = { it }, - indicator = { "${(it * 100.0f).roundToInt()}%" }, - steps = 16 - ) - } - } - item(span = { GridItemSpan(maxCurrentLineSpan) }) { - CompositionLocalProvider(LocalLayoutDirection provides originalDirection) { - SettingSlider( - title = "Keyboard Offset", - setting = KeyboardBottomOffsetSetting, - range = 0.0f..50.0f, - hardRange = 0.0f..250.0f, - transform = { it }, - indicator = { "${String.format("%.1f", it)} dp" }, - steps = 9 - ) - } - } } } } diff --git a/java/src/org/futo/inputmethod/updates/Update.kt b/java/src/org/futo/inputmethod/updates/Update.kt index fffb2b45d..bfcedb6ae 100644 --- a/java/src/org/futo/inputmethod/updates/Update.kt +++ b/java/src/org/futo/inputmethod/updates/Update.kt @@ -136,6 +136,7 @@ val dismissedMigrateUpdateNotice = SettingsKey( @Composable @Preview fun ConditionalMigrateUpdateNotice() { + if(LocalInspectionMode.current) { return } val context = LocalContext.current val value = useDataStore(dismissedMigrateUpdateNotice, blocking = true) if(!value.value) { diff --git a/tools/make-keyboard-text-py/locales/DEFAULT.json b/tools/make-keyboard-text-py/locales/DEFAULT.json index 8b0abf7e7..c9f039049 100644 --- a/tools/make-keyboard-text-py/locales/DEFAULT.json +++ b/tools/make-keyboard-text-py/locales/DEFAULT.json @@ -1,28 +1,84 @@ { "locale": "DEFAULT", "morekeys": { - "a": [], + "q": [], + "w": [], "e": [], - "i": [], - "o": [], - "u": [], - "s": [], - "n": [], - "c": [], - "y": [], - "d": [], "r": [], "t": [], - "z": [], - "k": [], - "l": [], + "y": [], + "u": [], + "i": [], + "o": [], + "p": [], + "a": [], + "s": [], + "d": [], + "f": [], "g": [], - "v": [], "h": [], "j": [], - "w": [], - "q": [], + "k": [], + "l": [], + "z": [], "x": [], + "c": [], + "v": [], + "b": [], + "n": [], + "m": [], + + "misc_a": [ + "à", + "á", + "â", + "ä", + "æ", + "ã", + "å", + "ā" + ], + "misc_e": [ + "é", + "è", + "ê", + "ë", + "ē" + ], + "misc_i": [ + "í", + "î", + "ï", + "ī", + "ì" + ], + "misc_o": [ + "ó", + "ô", + "ö", + "ò", + "œ", + "ø", + "ō", + "õ" + ], + "misc_u": [ + "ú", + "û", + "ü", + "ù", + "ū" + ], + "misc_s": [ + "ß" + ], + "misc_n": [ + "ñ" + ], + "misc_c": [ + "ç" + ], + "nordic_row2_10": [], "nordic_row2_11": [], "east_slavic_row2_2": [], @@ -55,6 +111,7 @@ "₱" ], "punctuation": [ + "/", "?", "!", "\u203d", @@ -65,6 +122,7 @@ "=" ], "tablet_punctuation": [ + "/", "?", "!", "\u203d", @@ -314,6 +372,119 @@ "double_lqm_rqm": "„,“,”", "double_9qm_lqm": "”,„,“", "double_9qm_rqm": "“,„,”", - "double_rqm_9qm": "“,”,„" + "double_rqm_9qm": "“,”,„", + + "number_1": "1", + "number_2": "2", + "number_3": "3", + "number_4": "4", + "number_5": "5", + "number_6": "6", + "number_7": "7", + "number_8": "8", + "number_9": "9", + "number_0": "0" + }, + + "actions": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [], + "6": [], + "7": [], + "8": [], + "9": [], + "0": [], + + "q": [], + "w": [], + "e": [], + "r": [], + "t": [], + "y": [ + "!icon/action_redo|!code/action_redo" + ], + "u": [], + "i": [], + "o": [], + "p": [], + + "a": [ + "!icon/action_select_all|!code/action_select_all" + ], + "s": [], + "d": [], + "f": [], + "g": [], + "h": [], + "j": [], + "k": [], + "l": [], + + "z": [ + "!icon/action_undo|!code/action_undo" + ], + "x": [ + "!icon/action_cut|!code/action_cut" + ], + "c": [ + "!icon/action_copy|!code/action_copy" + ], + "v": [ + "!icon/action_paste|!code/action_paste" + ], + "b": [], + "n": [], + "m": [] + }, + + "qwertysyms": { + "1": "!", + "2": "@", + "3": "#", + "4": "$", + "5": "%", + "6": "^", + "7": "&", + "8": "*", + "9": "(", + "0": ")", + + "q": "\\%", + "w": "\\\\", + "e": "|", + "r": "=", + "t": "[", + "y": "]", + "u": "<", + "i": ">", + "o": "{", + "p": "}", + + "a": "@", + "s": "#", + "d": [ + "$", + "€", + "£", + "¥", + "¢" + ], + "f": "\\%", + "g": ["&", "|"], + "h": ["-", "–", "—", "_"], + "j": ["+", "="], + "k": ["(", "[", "{", "<"], + "l": [")", "]", "}", ">" ], + + "z": "*", + "x": "\"", + "c": "'", + "v": ":", + "b": ";", + "n": "!", + "m": ["?", "/"] } } \ No newline at end of file diff --git a/tools/make-keyboard-text-py/locales/en.json b/tools/make-keyboard-text-py/locales/en.json index 77e2c1ccb..941f312ac 100644 --- a/tools/make-keyboard-text-py/locales/en.json +++ b/tools/make-keyboard-text-py/locales/en.json @@ -1,57 +1,6 @@ { "locale": "en", - "morekeys": { - "a": [ - "à", - "á", - "â", - "ä", - "æ", - "ã", - "å", - "ā" - ], - "e": [ - "é", - "è", - "ê", - "ë", - "ē" - ], - "i": [ - "í", - "î", - "ï", - "ī", - "ì" - ], - "o": [ - "ó", - "ô", - "ö", - "ò", - "œ", - "ø", - "ō", - "õ" - ], - "u": [ - "ú", - "û", - "ü", - "ù", - "ū" - ], - "s": [ - "ß" - ], - "n": [ - "ñ" - ], - "c": [ - "ç" - ] - }, + "morekeys": {}, "keyspec": {}, "label": {}, "keylabel": {}, diff --git a/tools/make-keyboard-text-py/src/generate.py b/tools/make-keyboard-text-py/src/generate.py index fab01d7f4..402112f29 100644 --- a/tools/make-keyboard-text-py/src/generate.py +++ b/tools/make-keyboard-text-py/src/generate.py @@ -16,10 +16,13 @@ def transform_to_texts(locale_data): texts["locale"] = locale_data["locale"] - prefixes = ['morekeys_', 'keyspec_', 'label_', 'keylabel_', 'keyhintlabel_', 'additional_morekeys_'] + prefixes = ['morekeys_', 'keyspec_', 'label_', 'keylabel_', 'keyhintlabel_', 'additional_morekeys_', 'qwertysyms_', 'actions_'] for prefix in prefixes: - for k, v in locale_data[prefix.rstrip("_")].items(): + key = prefix.rstrip("_") + if key not in locale_data: continue + + for k, v in locale_data[key].items(): if isinstance(v, list): texts[prefix + k] = ",".join(v) else: