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: If5ec731c9a490da0116a020e8fd405c7d025d707main
parent
fd47b5d09c
commit
580e1d7ac0
Binary file not shown.
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 242 B |
Binary file not shown.
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 222 B |
Binary file not shown.
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 310 B |
|
@ -413,8 +413,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
||||||
// TODO: This "more suggestions hint" should have nicely designed icon.
|
// TODO: This "more suggestions hint" should have nicely designed icon.
|
||||||
word.setCompoundDrawablesWithIntrinsicBounds(
|
word.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
null, null, null, mMoreCandidateHint);
|
null, null, null, mMoreCandidateHint);
|
||||||
|
// HACK: To align with other TextView that has no compound drawables.
|
||||||
|
word.setCompoundDrawablePadding(-mMoreCandidateHint.getIntrinsicHeight());
|
||||||
} else {
|
} else {
|
||||||
word.setCompoundDrawables(null, null, null, null);
|
word.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable this candidate if the suggestion is null or empty.
|
// 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.setText(text); // TextView.setText() resets text scale x to 1.0.
|
||||||
word.setTextScaleX(scaleX);
|
word.setTextScaleX(scaleX);
|
||||||
stripView.addView(word);
|
stripView.addView(word);
|
||||||
setLayoutWeight(word, getCandidateWeight(index), mCandidateStripHeight);
|
setLayoutWeight(word, getCandidateWeight(index), MATCH_PARENT);
|
||||||
|
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
final CharSequence debugInfo = getDebugInfo(suggestions, pos);
|
final CharSequence debugInfo = getDebugInfo(suggestions, pos);
|
||||||
|
@ -526,8 +528,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
||||||
|
|
||||||
mPreviewPopup = new PopupWindow(context);
|
mPreviewPopup = new PopupWindow(context);
|
||||||
mPreviewText = (TextView) inflater.inflate(R.layout.candidate_preview, null);
|
mPreviewText = (TextView) inflater.inflate(R.layout.candidate_preview, null);
|
||||||
mPreviewPopup.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,
|
mPreviewPopup.setWindowLayoutMode(WRAP_CONTENT, WRAP_CONTENT);
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
||||||
mPreviewPopup.setContentView(mPreviewText);
|
mPreviewPopup.setContentView(mPreviewText);
|
||||||
mPreviewPopup.setBackgroundDrawable(null);
|
mPreviewPopup.setBackgroundDrawable(null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue