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

Commit 891a318d authored by Angus Kong's avatar Angus Kong
Browse files

Measure children after the dimension is determined.

Also, the setMeasuredDimension() in onMeasure() is not necessary as we already
called super.

bug:9680271
Change-Id: I639454e515edb3027c9e79347d2124a1fcaa529b
parent 0c6bf511
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -348,6 +348,11 @@ public class FilmStripView extends ViewGroup {

        int boundWidth = MeasureSpec.getSize(widthMeasureSpec);
        int boundHeight = MeasureSpec.getSize(heightMeasureSpec);
        if (boundWidth == 0 || boundHeight == 0) {
            // Either width or height is unknown, can't measure children yet.
            return;
        }

        if (mDataAdapter != null) {
            mDataAdapter.suggestDecodeSize(boundWidth / 2, boundHeight / 2);
        }
@@ -368,7 +373,6 @@ public class FilmStripView extends ViewGroup {
                    View.MeasureSpec.makeMeasureSpec(
                            dim[1], View.MeasureSpec.EXACTLY));
        }
        setMeasuredDimension(boundWidth, boundHeight);
    }

    private int findTheNearestView(int pointX) {