diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Utils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Utils.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index 6bdc0a857..16a2b0e5f 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -190,6 +190,18 @@ public class Utils { } } + public static boolean canBeFollowedByPeriod(final int codePoint) { + // TODO: Check again whether there really ain't a better way to check this. + // TODO: This should probably be language-dependant... + return Character.isLetterOrDigit(codePoint) + || codePoint == Keyboard.CODE_SINGLE_QUOTE + || codePoint == Keyboard.CODE_DOUBLE_QUOTE + || codePoint == Keyboard.CODE_CLOSING_PARENTHESIS + || codePoint == Keyboard.CODE_CLOSING_SQUARE_BRACKET + || codePoint == Keyboard.CODE_CLOSING_CURLY_BRACKET + || codePoint == Keyboard.CODE_CLOSING_ANGLE_BRACKET; + } + /* package */ static class RingCharBuffer { private static RingCharBuffer sRingCharBuffer = new RingCharBuffer(); private static final char PLACEHOLDER_DELIMITER_CHAR = '\uFFFC'; @@ -546,11 +558,11 @@ public class Utils { } } - public static int getKeyboardMode(EditorInfo attribute) { - if (attribute == null) + public static int getKeyboardMode(EditorInfo editorInfo) { + if (editorInfo == null) return KeyboardId.MODE_TEXT; - final int inputType = attribute.inputType; + final int inputType = editorInfo.inputType; final int variation = inputType & InputType.TYPE_MASK_VARIATION; switch (inputType & InputType.TYPE_MASK_CLASS) { @@ -587,11 +599,11 @@ public class Utils { } public static boolean inPrivateImeOptions(String packageName, String key, - EditorInfo attribute) { - if (attribute == null) + EditorInfo editorInfo) { + if (editorInfo == null) return false; return containsInCsv(packageName != null ? packageName + "." + key : key, - attribute.privateImeOptions); + editorInfo.privateImeOptions); } /** |