From 05bfd189a88be79ddfc74d0ea21792e2fb78f2aa Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 16 Feb 2012 23:14:14 -0800 Subject: Add next/prev navigate action more keys and remove tab key Bug: 6037537 Bug: 5961814 Change-Id: I9c6dedf953452a180fcd5bce7bfadfd3c821f224 --- .../com/android/inputmethod/compat/EditorInfoCompatUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java') diff --git a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java index 3247997f6..938388d6c 100644 --- a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java @@ -39,30 +39,30 @@ public class EditorInfoCompatUtils { private static final Integer OBJ_IME_ACTION_PREVIOUS = (Integer) CompatUtils .getFieldValue(null, null, FIELD_IME_ACTION_PREVIOUS); + // EditorInfo.IME_FLAG_NAVIGATE_NEXT has been introduced since API#11 (Honeycomb). public static boolean hasFlagNavigateNext(int imeOptions) { if (OBJ_IME_FLAG_NAVIGATE_NEXT == null) return false; return (imeOptions & OBJ_IME_FLAG_NAVIGATE_NEXT) != 0; } + // EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS has been introduced since API#11 (Honeycomb). public static boolean hasFlagNavigatePrevious(int imeOptions) { if (OBJ_IME_FLAG_NAVIGATE_PREVIOUS == null) return false; return (imeOptions & OBJ_IME_FLAG_NAVIGATE_PREVIOUS) != 0; } + // EditorInfo.IME_FLAG_FORCE_ASCII has been introduced since API#16 (JellyBean). public static boolean hasFlagForceAscii(int imeOptions) { if (OBJ_IME_FLAG_FORCE_ASCII == null) return false; return (imeOptions & OBJ_IME_FLAG_FORCE_ASCII) != 0; } - public static void performEditorActionNext(InputConnection ic) { - ic.performEditorAction(EditorInfo.IME_ACTION_NEXT); - } - + // EditorInfo.IME_ACTION_PREVIOUS has been introduced since API#11 (Honeycomb). public static void performEditorActionPrevious(InputConnection ic) { - if (OBJ_IME_ACTION_PREVIOUS == null) + if (OBJ_IME_ACTION_PREVIOUS == null || ic == null) return; ic.performEditorAction(OBJ_IME_ACTION_PREVIOUS); } -- cgit v1.2.3-83-g751a