Merge "Remove dead area around separators in the suggestion strip"

main
Tadashi G. Takaoka 2011-07-28 17:39:43 -07:00 committed by Android (Google) Code Review
commit ecf43d4f9d
1 changed files with 6 additions and 3 deletions

View File

@ -323,8 +323,11 @@ public class CandidateView extends LinearLayout implements OnClickListener {
word.setTag(i); word.setTag(i);
word.setOnClickListener(this); word.setOnClickListener(this);
mWords.add(word); mWords.add(word);
final View divider = inflater.inflate(R.layout.candidate_divider, null);
divider.setTag(i);
divider.setOnClickListener(this);
mDividers.add(divider);
mInfos.add((TextView)inflater.inflate(R.layout.candidate_info, null)); mInfos.add((TextView)inflater.inflate(R.layout.candidate_info, null));
mDividers.add(inflater.inflate(R.layout.candidate_divider, null));
} }
mTouchToSave = findViewById(R.id.touch_to_save); mTouchToSave = findViewById(R.id.touch_to_save);
@ -476,6 +479,7 @@ public class CandidateView extends LinearLayout implements OnClickListener {
final TextView word = mWords.get(pos); final TextView word = mWords.get(pos);
final TextPaint paint = word.getPaint(); final TextPaint paint = word.getPaint();
final View divider = mDividers.get(pos);
// TODO: Reorder candidates in strip as appropriate. The center candidate should hold // TODO: Reorder candidates in strip as appropriate. The center candidate should hold
// the word when space is typed (valid typed word or auto corrected word). // the word when space is typed (valid typed word or auto corrected word).
word.setTextColor(getCandidateTextColor(isAutoCorrect, word.setTextColor(getCandidateTextColor(isAutoCorrect,
@ -505,7 +509,7 @@ public class CandidateView extends LinearLayout implements OnClickListener {
word.setTextScaleX(scaleX); word.setTextScaleX(scaleX);
if (i != 0) { if (i != 0) {
// Add divider if this isn't the left most suggestion in candidate strip. // Add divider if this isn't the left most suggestion in candidate strip.
mCandidatesStrip.addView(mDividers.get(i)); mCandidatesStrip.addView(divider);
} }
mCandidatesStrip.addView(word); mCandidatesStrip.addView(word);
if (params.mCanUseFixedWidthColumns) { if (params.mCanUseFixedWidthColumns) {
@ -534,7 +538,6 @@ public class CandidateView extends LinearLayout implements OnClickListener {
} }
if (x != 0) { if (x != 0) {
// Add divider if this isn't the left most suggestion in current row. // Add divider if this isn't the left most suggestion in current row.
final View divider = mDividers.get(i);
mCandidatesPane.addView(divider); mCandidatesPane.addView(divider);
FrameLayoutCompatUtils.placeViewAt( FrameLayoutCompatUtils.placeViewAt(
divider, x, y + (mCandidateStripHeight - params.mDividerHeight) / 2, divider, x, y + (mCandidateStripHeight - params.mDividerHeight) / 2,