From 7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 13 Apr 2011 14:12:24 +0900 Subject: Fast key preview Previously the key preview was implemented by PopupWindow. The key preview popup window would be dismissed and shown each time the key was released and pressed. It turned out that it was taking several milliseconds. This change implements the key preview by a simple TextView which will be layout-ed at absolute coordinates within the screen FrameLayout. And dismissing and showing the key preview is implemented by the TextView's visibility. This implementation needs careful coordination of candidates.xml layout and LatinIME.onComputeInsets to control suggestion strip visibility. Bug: 4179964 Change-Id: Id6347cb35b91eb14ab20dd2f312e58b54b6625a7 --- .../compat/InputMethodServiceCompatWrapper.java | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java') diff --git a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java index e02aac704..1ea7236f9 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java @@ -19,20 +19,9 @@ package com.android.inputmethod.compat; import com.android.inputmethod.latin.SubtypeSwitcher; import android.inputmethodservice.InputMethodService; -import android.view.View; import android.view.inputmethod.InputMethodSubtype; -import android.widget.HorizontalScrollView; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; public class InputMethodServiceCompatWrapper extends InputMethodService { - private static final Method METHOD_HorizontalScrollView_setOverScrollMode = - CompatUtils.getMethod(HorizontalScrollView.class, "setOverScrollMode", int.class); - private static final Field FIELD_View_OVER_SCROLL_NEVER = - CompatUtils.getField(View.class, "OVER_SCROLL_NEVER"); - private static final Integer View_OVER_SCROLL_NEVER = - (Integer)CompatUtils.getFieldValue(null, null, FIELD_View_OVER_SCROLL_NEVER); // CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED needs to be false if the API level is 10 // or previous. Note that InputMethodSubtype was added in the API level 11. // For the API level 11 or later, LatinIME should override onCurrentInputMethodSubtypeChanged(). @@ -66,13 +55,6 @@ public class InputMethodServiceCompatWrapper extends InputMethodService { } } - protected static void setOverScrollModeNever(HorizontalScrollView scrollView) { - if (View_OVER_SCROLL_NEVER != null) { - CompatUtils.invoke(scrollView, null, METHOD_HorizontalScrollView_setOverScrollMode, - View_OVER_SCROLL_NEVER); - } - } - ////////////////////////////////////// // Functions using API v11 or later // ////////////////////////////////////// -- cgit v1.2.3-83-g751a