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

Commit 6cde120f authored by Ats Jenk's avatar Ats Jenk
Browse files

Send expanded view drop target size to launcher

When starting to drag a bubble, send expanded view drop target size to
launcher as part of the bubble update.

Bug: 330585402
Test: testing with launcher changes
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Change-Id: I671f15c61e3c2797a04671ff1273c9dbf552f751
parent c421ef13
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1169,6 +1169,15 @@ public class BubbleController implements ConfigurationChangeListener,
     */
    public void startBubbleDrag(String bubbleKey) {
        onBubbleDrag(bubbleKey, true /* isBeingDragged */);
        if (mBubbleStateListener != null) {
            boolean overflow = BubbleOverflow.KEY.equals(bubbleKey);
            Rect rect = new Rect();
            mBubblePositioner.getBubbleBarExpandedViewBounds(mBubblePositioner.isBubbleBarOnLeft(),
                    overflow, rect);
            BubbleBarUpdate update = new BubbleBarUpdate();
            update.expandedViewDropTargetSize = new Point(rect.width(), rect.height());
            mBubbleStateListener.onBubbleStateChange(update);
        }
    }

    /**
+12 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.wm.shell.common.bubbles;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Point;
import android.os.Parcel;
import android.os.Parcelable;

@@ -49,6 +50,8 @@ public class BubbleBarUpdate implements Parcelable {
    public String unsupressedBubbleKey;
    @Nullable
    public BubbleBarLocation bubbleBarLocation;
    @Nullable
    public Point expandedViewDropTargetSize;

    // This is only populated if bubbles have been removed.
    public List<RemovedBubble> removedBubbles = new ArrayList<>();
@@ -81,12 +84,14 @@ public class BubbleBarUpdate implements Parcelable {
        suppressedBubbleKey = parcel.readString();
        unsupressedBubbleKey = parcel.readString();
        removedBubbles = parcel.readParcelableList(new ArrayList<>(),
                RemovedBubble.class.getClassLoader());
                RemovedBubble.class.getClassLoader(), RemovedBubble.class);
        parcel.readStringList(bubbleKeysInOrder);
        currentBubbleList = parcel.readParcelableList(new ArrayList<>(),
                BubbleInfo.class.getClassLoader());
                BubbleInfo.class.getClassLoader(), BubbleInfo.class);
        bubbleBarLocation = parcel.readParcelable(BubbleBarLocation.class.getClassLoader(),
                BubbleBarLocation.class);
        expandedViewDropTargetSize = parcel.readParcelable(Point.class.getClassLoader(),
                Point.class);
    }

    /**
@@ -105,6 +110,7 @@ public class BubbleBarUpdate implements Parcelable {
                || bubbleBarLocation != null;
    }

    @NonNull
    @Override
    public String toString() {
        return "BubbleBarUpdate{"
@@ -121,6 +127,7 @@ public class BubbleBarUpdate implements Parcelable {
                + " bubbles=" + bubbleKeysInOrder
                + " currentBubbleList=" + currentBubbleList
                + " bubbleBarLocation=" + bubbleBarLocation
                + " expandedViewDropTargetSize=" + expandedViewDropTargetSize
                + " }";
    }

@@ -144,6 +151,7 @@ public class BubbleBarUpdate implements Parcelable {
        parcel.writeStringList(bubbleKeysInOrder);
        parcel.writeParcelableList(currentBubbleList, flags);
        parcel.writeParcelable(bubbleBarLocation, flags);
        parcel.writeParcelable(expandedViewDropTargetSize, flags);
    }

    /**
@@ -157,10 +165,11 @@ public class BubbleBarUpdate implements Parcelable {

    @NonNull
    public static final Creator<BubbleBarUpdate> CREATOR =
            new Creator<BubbleBarUpdate>() {
            new Creator<>() {
                public BubbleBarUpdate createFromParcel(Parcel source) {
                    return new BubbleBarUpdate(source);
                }

                public BubbleBarUpdate[] newArray(int size) {
                    return new BubbleBarUpdate[size];
                }