diff options
author | 2011-04-13 14:12:24 +0900 | |
---|---|---|
committer | 2011-04-13 18:59:33 +0900 | |
commit | 7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92 (patch) | |
tree | 0975cb3d2df4eced4c836078291306761f136991 /java/res/layout-xlarge | |
parent | 47d2ef69d3f94e68bf675967ce3140cbb6179279 (diff) | |
download | latinime-7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92.tar.gz latinime-7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92.tar.xz latinime-7a3d3ae17f7a8ca0b44e9c92328a7de7cbc80f92.zip |
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
Diffstat (limited to 'java/res/layout-xlarge')
-rw-r--r-- | java/res/layout-xlarge/candidates.xml | 40 |
1 files changed, 24 insertions, 16 deletions
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 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" + android:gravity="bottom" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/keyboard_suggest_strip_holo" - android:paddingRight="@dimen/candidate_strip_padding" - android:paddingLeft="@dimen/candidate_strip_padding" + android:minHeight="@dimen/candidate_strip_minimum_height" > - <HorizontalScrollView - android:id="@+id/candidates_scroll_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:fadingEdge="horizontal" - android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length" - android:scrollbars="none" + <!-- On tablets, the candidate strip is centered with horizontal paddings on both sides because + width of the landscape mode is too long for the candidate strip. This LinearLayout is + required to hold the paddings. --> + <LinearLayout + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="@dimen/candidate_strip_height" + android:background="@drawable/keyboard_suggest_strip_holo" + android:paddingRight="@dimen/candidate_strip_padding" + android:paddingLeft="@dimen/candidate_strip_padding" > - <com.android.inputmethod.latin.CandidateView - android:id="@+id/candidates" - android:orientation="horizontal" + <HorizontalScrollView android:layout_width="match_parent" - android:layout_height="@dimen/candidate_strip_height" - android:background="@drawable/keyboard_suggest_strip_holo" /> - </HorizontalScrollView> + android:layout_height="match_parent" + android:fadingEdge="horizontal" + android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length" + android:scrollbars="none" + > + <com.android.inputmethod.latin.CandidateView + android:id="@+id/candidates" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + </HorizontalScrollView> + </LinearLayout> </LinearLayout> |