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

Commit 615dd422 authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 81979f8c: am df6ca3cd: am efb49bd8: Merge "Constrain width and height to >=...

am 81979f8c: am df6ca3cd: am efb49bd8: Merge "Constrain width and height to >= 0 in FastScroller layout" into mnc-dev

* commit '81979f8c':
  Constrain width and height to >= 0 in FastScroller layout
parents d9515f52 81979f8c
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -660,10 +660,11 @@ class FastScroller {
            maxWidth = containerWidth - adjacent.getRight();
        }

        final int adjMaxHeight = Math.max(0, container.height());
        final int adjMaxWidth = Math.max(0, maxWidth - marginLeft - marginRight);
        final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(adjMaxWidth, MeasureSpec.AT_MOST);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(container.height(),
                MeasureSpec.UNSPECIFIED);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(
                adjMaxHeight, MeasureSpec.UNSPECIFIED);
        view.measure(widthMeasureSpec, heightMeasureSpec);

        // Align to the left or right.
@@ -700,10 +701,11 @@ class FastScroller {

        final Rect container = mContainerRect;
        final int containerWidth = container.width();
        final int adjMaxWidth = containerWidth - marginLeft - marginRight;
        final int adjMaxHeight = Math.max(0, container.height());
        final int adjMaxWidth = Math.max(0, containerWidth - marginLeft - marginRight);
        final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(adjMaxWidth, MeasureSpec.AT_MOST);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(container.height(),
                MeasureSpec.UNSPECIFIED);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(
                adjMaxHeight, MeasureSpec.UNSPECIFIED);
        preview.measure(widthMeasureSpec, heightMeasureSpec);

        // Align at the vertical center, 10% from the top.
@@ -766,10 +768,11 @@ class FastScroller {
        final View track = mTrackImage;
        final View thumb = mThumbImage;
        final Rect container = mContainerRect;
        final int maxWidth = container.width();
        final int maxWidth = Math.max(0, container.width());
        final int maxHeight = Math.max(0, container.height());
        final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.AT_MOST);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(container.height(),
                MeasureSpec.UNSPECIFIED);
        final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec(
                maxHeight, MeasureSpec.UNSPECIFIED);
        track.measure(widthMeasureSpec, heightMeasureSpec);

        final int top;