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

Commit 0debe0b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Replace stream operation with simple iteration"

parents b6dfc37a cb2fdb8b
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -374,21 +374,21 @@ final class SmartSelectSprite {
        final List<RoundedRectangleShape> shapes = new LinkedList<>();
        final List<RoundedRectangleShape> shapes = new LinkedList<>();
        final List<Animator> cornerAnimators = new LinkedList<>();
        final List<Animator> cornerAnimators = new LinkedList<>();


        final RectF centerRectangle = destinationRectangles
        RectF centerRectangle = null;
                .stream()
                .filter((r) -> contains(r, start))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException(
                        "Center point is not inside any of the rectangles!"));


        int startingOffset = 0;
        int startingOffset = 0;
        for (RectF rectangle : destinationRectangles) {
        for (RectF rectangle : destinationRectangles) {
            if (rectangle.equals(centerRectangle)) {
            if (contains(rectangle, start)) {
                centerRectangle = rectangle;
                break;
                break;
            }
            }
            startingOffset += rectangle.width();
            startingOffset += rectangle.width();
        }
        }


        if (centerRectangle == null) {
            throw new IllegalArgumentException("Center point is not inside any of the rectangles!");
        }

        startingOffset += start.x - centerRectangle.left;
        startingOffset += start.x - centerRectangle.left;


        final float centerRectangleHalfHeight = centerRectangle.height() / 2;
        final float centerRectangleHalfHeight = centerRectangle.height() / 2;