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

Commit ae9917f9 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Use AT_MOST for label when photo is on right

In I269175d9dea97baa86bcb1badc9e6294dcb7883b we introduced EXACTLY,
since AT_MOST requires more calculation and thus made the contacts
listing slower.

In picker screens, however, we need that for email/phone types because
of its layout requirement. This change introduces AT_MOST only in that
exact case, so that it won't cause any performance regression in our
major cases.

Bug: 5527030
Change-Id: I105e8c052e53d9f108c7ca01c6aef2cc5c378462
parent 772e51f4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -394,7 +394,11 @@ public class ContactListItemView extends ViewGroup
        }

        if (isVisible(mLabelView)) {
            mLabelView.measure(MeasureSpec.makeMeasureSpec(labelWidth, MeasureSpec.EXACTLY),
            // For performance reason we don't want AT_MOST usually, but when the picture is
            // on right, we need to use it anyway because mDataView is next to mLabelView.
            final int mode = (mPhotoPosition == PhotoPosition.LEFT
                    ? MeasureSpec.EXACTLY : MeasureSpec.AT_MOST);
            mLabelView.measure(MeasureSpec.makeMeasureSpec(labelWidth, mode),
                    MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
            mLabelViewHeight = mLabelView.getMeasuredHeight();
        }