Merge "Fix suggestions strip press state to align vertically"

This commit is contained in:
Tadashi G. Takaoka 2011-08-24 03:35:57 -07:00 committed by Android (Google) Code Review
commit 1d59e0dbdf
4 changed files with 5 additions and 4 deletions

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

View file

@ -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);