aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/CandidateView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-08-24 03:35:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-24 03:35:57 -0700
commit1d59e0dbdf1c15c1e9d01f0ff678c9e421c972bc (patch)
tree4b0751ab5eb592286f7dec72748d85f43df687c1 /java/src/com/android/inputmethod/latin/CandidateView.java
parentdb73604d71b4572ceaf15134b5cbb7c18b20612b (diff)
parent580e1d7ac0cb90a464a3b3aed88047f85a4ab41f (diff)
downloadlatinime-1d59e0dbdf1c15c1e9d01f0ff678c9e421c972bc.tar.gz
latinime-1d59e0dbdf1c15c1e9d01f0ff678c9e421c972bc.tar.xz
latinime-1d59e0dbdf1c15c1e9d01f0ff678c9e421c972bc.zip
Merge "Fix suggestions strip press state to align vertically"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/CandidateView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/CandidateView.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index d46b4b5b5..5f20c70b4 100644
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -413,8 +413,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
// TODO: This "more suggestions hint" should have nicely designed icon.
word.setCompoundDrawablesWithIntrinsicBounds(
null, null, null, mMoreCandidateHint);
+ // HACK: To align with other TextView that has no compound drawables.
+ word.setCompoundDrawablePadding(-mMoreCandidateHint.getIntrinsicHeight());
} else {
- word.setCompoundDrawables(null, null, null, null);
+ word.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
// Disable this candidate if the suggestion is null or empty.
@@ -426,7 +428,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
word.setText(text); // TextView.setText() resets text scale x to 1.0.
word.setTextScaleX(scaleX);
stripView.addView(word);
- setLayoutWeight(word, getCandidateWeight(index), mCandidateStripHeight);
+ setLayoutWeight(word, getCandidateWeight(index), MATCH_PARENT);
if (DBG) {
final CharSequence debugInfo = getDebugInfo(suggestions, pos);
@@ -526,8 +528,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
mPreviewPopup = new PopupWindow(context);
mPreviewText = (TextView) inflater.inflate(R.layout.candidate_preview, null);
- mPreviewPopup.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,
- ViewGroup.LayoutParams.WRAP_CONTENT);
+ mPreviewPopup.setWindowLayoutMode(WRAP_CONTENT, WRAP_CONTENT);
mPreviewPopup.setContentView(mPreviewText);
mPreviewPopup.setBackgroundDrawable(null);