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

Commit 413500bb authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Add bubbles API to update bubble bar bounds" into main

parents 15b281ac 074972fd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2335,6 +2335,11 @@ public class BubbleController implements ConfigurationChangeListener,
            mMainExecutor.execute(() ->
                    mController.setBubbleBarLocation(location));
        }

        @Override
        public void setBubbleBarBounds(Rect bubbleBarBounds) {
            mMainExecutor.execute(() -> mBubblePositioner.setBubbleBarBounds(bubbleBarBounds));
        }
    }

    private class BubblesImpl implements Bubbles {
+2 −0
Original line number Diff line number Diff line
@@ -44,4 +44,6 @@ interface IBubbles {
    oneway void showUserEducation(in int positionX, in int positionY) = 8;

    oneway void setBubbleBarLocation(in BubbleBarLocation location) = 9;

    oneway void setBubbleBarBounds(in Rect bubbleBarBounds) = 10;
}
 No newline at end of file
+14 −9
Original line number Diff line number Diff line
@@ -166,13 +166,8 @@ public class BubbleBarAnimationHelper {
        bbev.setTaskViewAlpha(0f);
        bbev.setVisibility(VISIBLE);

        // Set the pivot point for the scale, so the view animates out from the bubble bar.
        Rect bubbleBarBounds = mPositioner.getBubbleBarBounds();
        mExpandedViewContainerMatrix.setScale(
                1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT,
                1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT,
                bubbleBarBounds.centerX(),
                bubbleBarBounds.top);
        setScaleFromBubbleBar(mExpandedViewContainerMatrix,
                1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT);

        bbev.setAnimationMatrix(mExpandedViewContainerMatrix);

@@ -214,8 +209,8 @@ public class BubbleBarAnimationHelper {
        }
        bbev.setScaleX(1f);
        bbev.setScaleY(1f);
        mExpandedViewContainerMatrix.setScaleX(1f);
        mExpandedViewContainerMatrix.setScaleY(1f);

        setScaleFromBubbleBar(mExpandedViewContainerMatrix, 1f);

        PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel();
        PhysicsAnimator.getInstance(mExpandedViewContainerMatrix)
@@ -240,6 +235,16 @@ public class BubbleBarAnimationHelper {
        mExpandedViewAlphaAnimator.reverse();
    }

    private void setScaleFromBubbleBar(AnimatableScaleMatrix matrix, float scale) {
        // Set the pivot point for the scale, so the view animates out from the bubble bar.
        Rect bubbleBarBounds = mPositioner.getBubbleBarBounds();
        matrix.setScale(
                scale,
                scale,
                bubbleBarBounds.centerX(),
                bubbleBarBounds.top);
    }

    /**
     * Animate the expanded bubble when it is being dragged
     */