Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fb04fe0 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix ragged suggestion strip baseline

Change-Id: I5fa9e2ad0993602e24f436e1d8ad0999209e5180
parent 4f0d290c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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" />
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −4
Original line number Diff line number Diff line
@@ -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.