Fix ragged suggestion strip baseline
Change-Id: I5fa9e2ad0993602e24f436e1d8ad0999209e5180main
parent
4f0d290c5d
commit
7fb04fe007
|
@ -24,4 +24,5 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:minWidth="@dimen/candidate_min_width"
|
||||
android:textSize="@dimen/candidate_text_size"
|
||||
android:padding="0dp"
|
||||
style="?attr/suggestionBackgroundStyle" />
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
android:orientation="horizontal"
|
||||
android:layout_weight="1.0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
<RelativeLayout
|
||||
|
|
|
@ -75,7 +75,6 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
private final ArrayList<TextView> mWords = new ArrayList<TextView>();
|
||||
private final ArrayList<TextView> mInfos = new ArrayList<TextView>();
|
||||
private final ArrayList<View> mDividers = new ArrayList<View>();
|
||||
private final int mCandidatePadding;
|
||||
private final int mCandidateStripHeight;
|
||||
private final CharacterStyle mInvertedForegroundColorSpan;
|
||||
private final CharacterStyle mInvertedBackgroundColorSpan;
|
||||
|
@ -179,14 +178,13 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
mPreviewPopup.setContentView(mPreviewText);
|
||||
mPreviewPopup.setBackgroundDrawable(null);
|
||||
|
||||
mCandidatePadding = res.getDimensionPixelOffset(R.dimen.candidate_padding);
|
||||
mCandidateStripHeight = res.getDimensionPixelOffset(R.dimen.candidate_strip_height);
|
||||
for (int i = 0; i < MAX_SUGGESTIONS; i++) {
|
||||
final TextView word, info;
|
||||
switch (i) {
|
||||
case 0:
|
||||
word = (TextView)findViewById(R.id.word_left);
|
||||
word.setPadding(mCandidatePadding, 0, 0, 0);
|
||||
word.setPadding(res.getDimensionPixelOffset(R.dimen.candidate_padding), 0, 0, 0);
|
||||
info = (TextView)findViewById(R.id.info_left);
|
||||
break;
|
||||
case 1:
|
||||
|
@ -355,7 +353,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
if (info != null) {
|
||||
final int infoWidth = info.getMeasuredWidth();
|
||||
FrameLayoutCompatUtils.placeViewAt(
|
||||
info, x + width - infoWidth, y, infoWidth, info.getMeasuredHeight());
|
||||
info, width - infoWidth, 0, infoWidth, info.getMeasuredHeight());
|
||||
}
|
||||
} else {
|
||||
// TODO: Handle overflow case.
|
||||
|
|
Loading…
Reference in New Issue