From 7fb04fe007a6d0489168e9c87771db554c873464 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Sun, 26 Jun 2011 02:07:07 +0900 Subject: [PATCH] Fix ragged suggestion strip baseline Change-Id: I5fa9e2ad0993602e24f436e1d8ad0999209e5180 --- java/res/layout/candidate_word.xml | 1 + java/res/layout/candidates_strip.xml | 2 +- java/src/com/android/inputmethod/latin/CandidateView.java | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/java/res/layout/candidate_word.xml b/java/res/layout/candidate_word.xml index 94ae2b44e..3d2ad06e4 100644 --- a/java/res/layout/candidate_word.xml +++ b/java/res/layout/candidate_word.xml @@ -24,4 +24,5 @@ android:layout_height="wrap_content" android:minWidth="@dimen/candidate_min_width" android:textSize="@dimen/candidate_text_size" + android:padding="0dp" style="?attr/suggestionBackgroundStyle" /> diff --git a/java/res/layout/candidates_strip.xml b/java/res/layout/candidates_strip.xml index c23c29cbe..bb11e057c 100644 --- a/java/res/layout/candidates_strip.xml +++ b/java/res/layout/candidates_strip.xml @@ -56,7 +56,7 @@ android:orientation="horizontal" android:layout_weight="1.0" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:gravity="center_vertical" > mWords = new ArrayList(); private final ArrayList mInfos = new ArrayList(); private final ArrayList mDividers = new ArrayList(); - private final int mCandidatePadding; private final int mCandidateStripHeight; private final CharacterStyle mInvertedForegroundColorSpan; private final CharacterStyle mInvertedBackgroundColorSpan; @@ -179,14 +178,13 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo mPreviewPopup.setContentView(mPreviewText); mPreviewPopup.setBackgroundDrawable(null); - mCandidatePadding = res.getDimensionPixelOffset(R.dimen.candidate_padding); mCandidateStripHeight = res.getDimensionPixelOffset(R.dimen.candidate_strip_height); for (int i = 0; i < MAX_SUGGESTIONS; i++) { final TextView word, info; switch (i) { case 0: word = (TextView)findViewById(R.id.word_left); - word.setPadding(mCandidatePadding, 0, 0, 0); + word.setPadding(res.getDimensionPixelOffset(R.dimen.candidate_padding), 0, 0, 0); info = (TextView)findViewById(R.id.info_left); break; case 1: @@ -355,7 +353,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo if (info != null) { final int infoWidth = info.getMeasuredWidth(); FrameLayoutCompatUtils.placeViewAt( - info, x + width - infoWidth, y, infoWidth, info.getMeasuredHeight()); + info, width - infoWidth, 0, infoWidth, info.getMeasuredHeight()); } } else { // TODO: Handle overflow case.