mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-04 13:50:14 +00:00
Disable automatic shift for Georgian only
This commit is contained in:
parent
ab778a9bb9
commit
a4d344e818
2 changed files with 60 additions and 51 deletions
|
@ -36,6 +36,7 @@ import org.dslul.openboard.inputmethod.keyboard.internal.UniqueKeysCache;
|
|||
import org.dslul.openboard.inputmethod.latin.InputAttributes;
|
||||
import org.dslul.openboard.inputmethod.latin.R;
|
||||
import org.dslul.openboard.inputmethod.latin.RichInputMethodSubtype;
|
||||
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.InputTypeUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.ScriptUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.SubtypeLocaleUtils;
|
||||
|
@ -104,7 +105,9 @@ public final class KeyboardLayoutSet {
|
|||
boolean mProximityCharsCorrectionEnabled;
|
||||
boolean mSupportsSplitLayout;
|
||||
boolean mAllowRedundantMoreKeys;
|
||||
public ElementParams() {}
|
||||
|
||||
public ElementParams() {
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Params {
|
||||
|
@ -162,9 +165,11 @@ public final class KeyboardLayoutSet {
|
|||
mParams = params;
|
||||
}
|
||||
|
||||
public static final String LOCALE_GEORGIAN = "ka";
|
||||
|
||||
@Nonnull
|
||||
public Keyboard getKeyboard(final int baseKeyboardLayoutSetElementId) {
|
||||
final int keyboardLayoutSetElementId;
|
||||
int keyboardLayoutSetElementId;
|
||||
switch (mParams.mMode) {
|
||||
case KeyboardId.MODE_PHONE:
|
||||
if (baseKeyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS) {
|
||||
|
@ -197,6 +202,11 @@ public final class KeyboardLayoutSet {
|
|||
|
||||
mParams.mIsSplitLayoutEnabled = mParams.mIsSplitLayoutEnabledByUser
|
||||
&& elementParams.mSupportsSplitLayout;
|
||||
|
||||
if (StringUtils.LANGUAGE_GEORGIAN.equals(mParams.mSubtype.getLocale().getLanguage()) && keyboardLayoutSetElementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
|
||||
keyboardLayoutSetElementId = KeyboardId.ELEMENT_ALPHABET;
|
||||
}
|
||||
|
||||
final KeyboardId id = new KeyboardId(keyboardLayoutSetElementId, mParams);
|
||||
try {
|
||||
return getKeyboard(elementParams, id);
|
||||
|
@ -279,8 +289,7 @@ public final class KeyboardLayoutSet {
|
|||
// be locked down.
|
||||
// TODO: Switch to {@code UserManagerCompat.isUserUnlocked()} in the support-v4 library
|
||||
// when it becomes publicly available.
|
||||
@UserManagerCompatUtils.LockState
|
||||
final int lockState = UserManagerCompatUtils.getUserLockState(context);
|
||||
@UserManagerCompatUtils.LockState final int lockState = UserManagerCompatUtils.getUserLockState(context);
|
||||
if (lockState == UserManagerCompatUtils.LOCK_STATE_LOCKED) {
|
||||
params.mNoSettingsKey = true;
|
||||
}
|
||||
|
@ -295,8 +304,7 @@ public final class KeyboardLayoutSet {
|
|||
public Builder setSubtype(@Nonnull final RichInputMethodSubtype subtype) {
|
||||
final boolean asciiCapable = subtype.getmSubtype().isAsciiCapable();
|
||||
// TODO: Consolidate with {@link InputAttributes}.
|
||||
@SuppressWarnings("deprecation")
|
||||
final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions(
|
||||
@SuppressWarnings("deprecation") final boolean deprecatedForceAscii = InputAttributes.inPrivateImeOptions(
|
||||
mPackageName, FORCE_ASCII, mParams.mEditorInfo);
|
||||
final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii(
|
||||
mParams.mEditorInfo.imeOptions)
|
||||
|
|
|
@ -26,6 +26,8 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
public final class StringUtils {
|
||||
public static final String LANGUAGE_GEORGIAN = "ka";
|
||||
|
||||
public static final int CAPITALIZE_NONE = 0; // No caps, or mixed case
|
||||
public static final int CAPITALIZE_FIRST = 1; // First only
|
||||
public static final int CAPITALIZE_ALL = 2; // All caps
|
||||
|
@ -583,7 +585,6 @@ public final class StringUtils {
|
|||
}
|
||||
|
||||
private static final String LANGUAGE_GREEK = "el";
|
||||
private static final String LANGUAGE_GEORGIAN = "ka";
|
||||
|
||||
@Nonnull
|
||||
private static Locale getLocaleUsedForToTitleCase(@Nonnull final Locale locale) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue