aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-08-24 17:35:42 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-08-24 18:15:19 +0900
commit580e1d7ac0cb90a464a3b3aed88047f85a4ab41f (patch)
tree74119fc378590e93a95316c7ffb142bcef4a3f31 /java/src
parentfd47b5d09c12a83145a2ee5d11473ca4f6fe3fc9 (diff)
downloadlatinime-580e1d7ac0cb90a464a3b3aed88047f85a4ab41f.tar.gz
latinime-580e1d7ac0cb90a464a3b3aed88047f85a4ab41f.tar.xz
latinime-580e1d7ac0cb90a464a3b3aed88047f85a4ab41f.zip
Fix suggestions strip press state to align vertically
This change also tweaks more_suggestions_hint drawables to eliminate unnecessarily padding at the bottom. Bug: 5204563 Change-Id: If5ec731c9a490da0116a020e8fd405c7d025d707
Diffstat (limited to 'java/src')
-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);