From 7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 13 Apr 2011 14:12:24 +0900 Subject: [PATCH 1/3] 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 --- java/res/anim/key_preview_fadein.xml | 29 ------- java/res/anim/key_preview_fadeout.xml | 29 ------- java/res/anim/mini_keyboard_fadein.xml | 2 +- java/res/anim/mini_keyboard_fadeout.xml | 2 +- java/res/layout-xlarge/candidates.xml | 40 +++++---- java/res/layout/candidates.xml | 13 ++- java/res/values-xlarge/dimens.xml | 3 + java/res/values/config.xml | 2 - java/res/values/dimens.xml | 3 + java/res/values/styles.xml | 4 - .../InputMethodServiceCompatWrapper.java | 18 ---- .../inputmethod/keyboard/KeyboardView.java | 87 ++++++------------- .../inputmethod/keyboard/PointerTracker.java | 2 +- .../inputmethod/latin/CandidateView.java | 1 - .../android/inputmethod/latin/LatinIME.java | 69 +++++++-------- 15 files changed, 98 insertions(+), 206 deletions(-) delete mode 100644 java/res/anim/key_preview_fadein.xml delete mode 100644 java/res/anim/key_preview_fadeout.xml diff --git a/java/res/anim/key_preview_fadein.xml b/java/res/anim/key_preview_fadein.xml deleted file mode 100644 index 9fad7b9a7..000000000 --- a/java/res/anim/key_preview_fadein.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/java/res/anim/key_preview_fadeout.xml b/java/res/anim/key_preview_fadeout.xml deleted file mode 100644 index 7de5123cd..000000000 --- a/java/res/anim/key_preview_fadeout.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/java/res/anim/mini_keyboard_fadein.xml b/java/res/anim/mini_keyboard_fadein.xml index 9fad7b9a7..f80e8b8de 100644 --- a/java/res/anim/mini_keyboard_fadein.xml +++ b/java/res/anim/mini_keyboard_fadein.xml @@ -25,5 +25,5 @@ + android:duration="@integer/config_mini_keyboard_fadein_anim_time" /> diff --git a/java/res/anim/mini_keyboard_fadeout.xml b/java/res/anim/mini_keyboard_fadeout.xml index 7de5123cd..535b100ae 100644 --- a/java/res/anim/mini_keyboard_fadeout.xml +++ b/java/res/anim/mini_keyboard_fadeout.xml @@ -25,5 +25,5 @@ + android:duration="@integer/config_mini_keyboard_fadeout_anim_time" /> diff --git a/java/res/layout-xlarge/candidates.xml b/java/res/layout-xlarge/candidates.xml index d10035c9c..9d6cd241c 100644 --- a/java/res/layout-xlarge/candidates.xml +++ b/java/res/layout-xlarge/candidates.xml @@ -21,25 +21,33 @@ - + - - + android:layout_height="match_parent" + android:fadingEdge="horizontal" + android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length" + android:scrollbars="none" + > + + + diff --git a/java/res/layout/candidates.xml b/java/res/layout/candidates.xml index 794c4ed42..39e39a1b7 100644 --- a/java/res/layout/candidates.xml +++ b/java/res/layout/candidates.xml @@ -21,25 +21,24 @@ + android:layout_height="match_parent" /> diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml index 0dc5621ff..9bb50f62a 100644 --- a/java/res/values-xlarge/dimens.xml +++ b/java/res/values-xlarge/dimens.xml @@ -46,6 +46,9 @@ 8.0mm 46dip + + 18mm 15.0mm 0.3in 12dip diff --git a/java/res/values/config.xml b/java/res/values/config.xml index bdb4409f0..32fb5bf1a 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -49,8 +49,6 @@ 15 0 10 - 0 - 70 0 100 400 diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 767dc4aa9..0a0b16d47 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -52,6 +52,9 @@ 0.193in 42dip + + 100sp 63dip 0dip 0.3in diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index 130714fd3..ef48a4bd2 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -35,10 +35,6 @@ 0.5 white -