diff options
| author | Menny Even Danan <menny@evendanan.net> | 2020-07-08 15:50:43 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-08 15:50:43 +0000 |
| commit | 63c191ab60acdfae173642f3c575616263f6c4bf (patch) | |
| tree | 26f96b868e372582b64fe7365143e2a7f3911465 /ime/app/src/main/java | |
| parent | 77c26eb7b621f69c19f82e1385e767636b3cd836 (diff) | |
| parent | 97f140addc3d9b85810a5914ba4db98360776df4 (diff) | |
| download | AnySoftKeyboard-63c191ab60acdfae173642f3c575616263f6c4bf.tar.gz AnySoftKeyboard-63c191ab60acdfae173642f3c575616263f6c4bf.tar.bz2 | |
Merge pull request #2367 from wishawa/master
Add ask:isShiftAlways and Thai language keyboard
Diffstat (limited to 'ime/app/src/main/java')
| -rw-r--r-- | ime/app/src/main/java/com/anysoftkeyboard/keyboards/AnyKeyboard.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/AnyKeyboard.java b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/AnyKeyboard.java index 03d22079b..3525fae91 100644 --- a/ime/app/src/main/java/com/anysoftkeyboard/keyboards/AnyKeyboard.java +++ b/ime/app/src/main/java/com/anysoftkeyboard/keyboards/AnyKeyboard.java @@ -760,6 +760,7 @@ public abstract class AnyKeyboard extends Keyboard { longPressCode = 0; shiftedKeyLabel = null; hintLabel = null; + boolean mShiftCodesAlwaysOverride = false; final int[] remoteStyleableArrayFromLocal = resourceMapping.getRemoteStyleableArrayFromLocal( @@ -789,6 +790,10 @@ public abstract class AnyKeyboard extends Keyboard { case R.attr.shiftedKeyLabel: shiftedKeyLabel = a.getString(remoteIndex); break; + case R.attr.isShiftAlways: + mShiftCodesAlwaysOverride = true; + mShiftCodesAlways = a.getBoolean(remoteIndex, false); + break; case R.attr.hintLabel: hintLabel = a.getString(remoteIndex); break; @@ -830,14 +835,16 @@ public abstract class AnyKeyboard extends Keyboard { } } - // if the shift-character is a symbol, we only show it if the SHIFT is pressed, - // not if the shift is active. - mShiftCodesAlways = - mShiftedCodes.length == 0 - || Character.isLetter(mShiftedCodes[0]) - || Character.getType(mShiftedCodes[0]) == Character.NON_SPACING_MARK - || Character.getType(mShiftedCodes[0]) - == Character.COMBINING_SPACING_MARK; + if (!mShiftCodesAlwaysOverride) { + // if the shift-character is a symbol, we only show it if the SHIFT is pressed, + // not if the shift is active. + mShiftCodesAlways = + mShiftedCodes.length == 0 + || Character.isLetter(mShiftedCodes[0]) + || Character.getType(mShiftedCodes[0]) == Character.NON_SPACING_MARK + || Character.getType(mShiftedCodes[0]) + == Character.COMBINING_SPACING_MARK; + } if (popupCharacters != null && popupCharacters.length() == 0) { // If there is a keyboard with no keys specified in |
