Loading quickstep/res/layout/transient_taskbar.xml +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ android:visibility="gone" android:gravity="center" android:clipChildren="false" android:elevation="@dimen/bubblebar_elevation" /> <FrameLayout Loading quickstep/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ <dimen name="bubblebar_stashed_size">@dimen/transient_taskbar_stashed_height</dimen> <dimen name="bubblebar_stashed_handle_height">@dimen/taskbar_stashed_handle_height</dimen> <dimen name="bubblebar_pointer_size">8dp</dimen> <dimen name="bubblebar_elevation">1dp</dimen> <dimen name="bubblebar_icon_size">50dp</dimen> <dimen name="bubblebar_badge_size">24dp</dimen> Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ import com.android.launcher3.taskbar.bubbles.BubbleBarController; import com.android.launcher3.taskbar.bubbles.BubbleBarView; import com.android.launcher3.taskbar.bubbles.BubbleBarViewController; import com.android.launcher3.taskbar.bubbles.BubbleControllers; import com.android.launcher3.taskbar.bubbles.BubbleDismissController; import com.android.launcher3.taskbar.bubbles.BubbleDragController; import com.android.launcher3.taskbar.bubbles.BubbleStashController; import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; Loading Loading @@ -216,7 +218,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new BubbleBarController(this, bubbleBarView), new BubbleBarViewController(this, bubbleBarView), new BubbleStashController(this), new BubbleStashedHandleViewController(this, bubbleHandleView))); new BubbleStashedHandleViewController(this, bubbleHandleView), new BubbleDragController(this), new BubbleDismissController(this, mDragLayer))); } // Construct controllers. Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +45 −5 Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ public class BubbleBarView extends FrameLayout { private View.OnClickListener mOnClickListener; private final Rect mTempRect = new Rect(); private float mRelativePivotX = 1f; private float mRelativePivotY = 1f; // An animator that represents the expansion state of the bubble bar, where 0 corresponds to the // collapsed state and 1 to the fully expanded state. Loading @@ -109,6 +111,9 @@ public class BubbleBarView extends FrameLayout { @Nullable private Consumer<String> mUpdateSelectedBubbleAfterCollapse; @Nullable private BubbleView mDraggedBubbleView; public BubbleBarView(Context context) { this(context, null); } Loading Loading @@ -181,9 +186,10 @@ public class BubbleBarView extends FrameLayout { mBubbleBarBounds.right = right; mBubbleBarBounds.bottom = bottom; // The bubble bar handle is aligned to the bottom edge of the screen so scale towards that. setPivotX(getWidth()); setPivotY(getHeight()); // The bubble bar handle is aligned according to the relative pivot, // by default it's aligned to the bottom edge of the screen so scale towards that setPivotX(mRelativePivotX * getWidth()); setPivotY(mRelativePivotY * getHeight()); // Position the views updateChildrenRenderNodeProperties(); Loading @@ -198,6 +204,32 @@ public class BubbleBarView extends FrameLayout { return mBubbleBarBounds; } /** * Set bubble bar relative pivot value for X and Y, applied as a fraction of view width/height * respectively. If the value is not in range of 0 to 1 it will be normalized. * @param x relative X pivot value in range 0..1 * @param y relative Y pivot value in range 0..1 */ public void setRelativePivot(float x, float y) { mRelativePivotX = Float.max(Float.min(x, 1), 0); mRelativePivotY = Float.max(Float.min(y, 1), 0); requestLayout(); } /** * Get current relative pivot for X axis */ public float getRelativePivotX() { return mRelativePivotX; } /** * Get current relative pivot for Y axis */ public float getRelativePivotY() { return mRelativePivotY; } // TODO: (b/280605790) animate it @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { Loading Loading @@ -254,9 +286,9 @@ public class BubbleBarView extends FrameLayout { // where the bubble will end up when the animation ends final float targetX = currentWidth - expandedWidth + expandedX; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(0); bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); Loading Loading @@ -331,6 +363,14 @@ public class BubbleBarView extends FrameLayout { updateArrowForSelected(/* shouldAnimate= */ true); } /** * Sets the dragged bubble view to correctly apply Z order. Dragged view should appear on top */ public void setDraggedBubble(@Nullable BubbleView view) { mDraggedBubbleView = view; requestLayout(); } /** * Update the arrow position to match the selected bubble. * Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +48 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import androidx.annotation.NonNull; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.taskbar.TaskbarActivityContext; Loading Loading @@ -54,6 +56,7 @@ public class BubbleBarViewController { // Initialized in init. private BubbleStashController mBubbleStashController; private BubbleBarController mBubbleBarController; private BubbleDragController mBubbleDragController; private TaskbarStashController mTaskbarStashController; private TaskbarInsetsController mTaskbarInsetsController; private View.OnClickListener mBubbleClickListener; Loading Loading @@ -85,6 +88,7 @@ public class BubbleBarViewController { public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) { mBubbleStashController = bubbleControllers.bubbleStashController; mBubbleBarController = bubbleControllers.bubbleBarController; mBubbleDragController = bubbleControllers.bubbleDragController; mTaskbarStashController = controllers.taskbarStashController; mTaskbarInsetsController = controllers.taskbarInsetsController; Loading @@ -95,6 +99,7 @@ public class BubbleBarViewController { mBubbleBarScale.updateValue(1f); mBubbleClickListener = v -> onBubbleClicked(v); mBubbleBarClickListener = v -> setExpanded(true); mBubbleDragController.setupBubbleBarView(mBarView); mBarView.setOnClickListener(mBubbleBarClickListener); mBarView.addOnLayoutChangeListener((view, i, i1, i2, i3, i4, i5, i6, i7) -> mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged() Loading Loading @@ -268,6 +273,7 @@ public class BubbleBarViewController { if (b != null) { mBarView.addView(b.getView(), 0, new FrameLayout.LayoutParams(mIconSize, mIconSize)); b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); } else { Log.w(TAG, "addBubble, bubble was null!"); } Loading Loading @@ -319,4 +325,46 @@ public class BubbleBarViewController { mBubbleStashController.showBubbleBar(true /* expand the bubbles */); } } /** * Updates the dragged bubble view in the bubble bar view, and notifies SystemUI * that a bubble is being dragged to dismiss. * @param bubbleView dragged bubble view */ public void onDragStart(@NonNull BubbleView bubbleView) { if (bubbleView.getBubble() == null) return; mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ true); mBarView.setDraggedBubble(bubbleView); } /** * Notifies SystemUI to expand the selected bubble when the bubble is released. * @param bubbleView dragged bubble view */ public void onDragRelease(@NonNull BubbleView bubbleView) { if (bubbleView.getBubble() == null) return; mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ false); } /** * Removes the dragged bubble view in the bubble bar view */ public void onDragEnd() { mBarView.setDraggedBubble(null); } /** * Called when bubble was dragged into the dismiss target. Notifies System * @param bubble dismissed bubble item */ public void onDismissBubbleWhileDragging(@NonNull BubbleBarItem bubble) { mSystemUiProxy.removeBubble(bubble.getKey()); } /** * Called when bubble stack was dragged into the dismiss target */ public void onDismissAllBubblesWhileDragging() { mSystemUiProxy.removeAllBubbles(); } } Loading
quickstep/res/layout/transient_taskbar.xml +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ android:visibility="gone" android:gravity="center" android:clipChildren="false" android:elevation="@dimen/bubblebar_elevation" /> <FrameLayout Loading
quickstep/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ <dimen name="bubblebar_stashed_size">@dimen/transient_taskbar_stashed_height</dimen> <dimen name="bubblebar_stashed_handle_height">@dimen/taskbar_stashed_handle_height</dimen> <dimen name="bubblebar_pointer_size">8dp</dimen> <dimen name="bubblebar_elevation">1dp</dimen> <dimen name="bubblebar_icon_size">50dp</dimen> <dimen name="bubblebar_badge_size">24dp</dimen> Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ import com.android.launcher3.taskbar.bubbles.BubbleBarController; import com.android.launcher3.taskbar.bubbles.BubbleBarView; import com.android.launcher3.taskbar.bubbles.BubbleBarViewController; import com.android.launcher3.taskbar.bubbles.BubbleControllers; import com.android.launcher3.taskbar.bubbles.BubbleDismissController; import com.android.launcher3.taskbar.bubbles.BubbleDragController; import com.android.launcher3.taskbar.bubbles.BubbleStashController; import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; Loading Loading @@ -216,7 +218,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new BubbleBarController(this, bubbleBarView), new BubbleBarViewController(this, bubbleBarView), new BubbleStashController(this), new BubbleStashedHandleViewController(this, bubbleHandleView))); new BubbleStashedHandleViewController(this, bubbleHandleView), new BubbleDragController(this), new BubbleDismissController(this, mDragLayer))); } // Construct controllers. Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +45 −5 Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ public class BubbleBarView extends FrameLayout { private View.OnClickListener mOnClickListener; private final Rect mTempRect = new Rect(); private float mRelativePivotX = 1f; private float mRelativePivotY = 1f; // An animator that represents the expansion state of the bubble bar, where 0 corresponds to the // collapsed state and 1 to the fully expanded state. Loading @@ -109,6 +111,9 @@ public class BubbleBarView extends FrameLayout { @Nullable private Consumer<String> mUpdateSelectedBubbleAfterCollapse; @Nullable private BubbleView mDraggedBubbleView; public BubbleBarView(Context context) { this(context, null); } Loading Loading @@ -181,9 +186,10 @@ public class BubbleBarView extends FrameLayout { mBubbleBarBounds.right = right; mBubbleBarBounds.bottom = bottom; // The bubble bar handle is aligned to the bottom edge of the screen so scale towards that. setPivotX(getWidth()); setPivotY(getHeight()); // The bubble bar handle is aligned according to the relative pivot, // by default it's aligned to the bottom edge of the screen so scale towards that setPivotX(mRelativePivotX * getWidth()); setPivotY(mRelativePivotY * getHeight()); // Position the views updateChildrenRenderNodeProperties(); Loading @@ -198,6 +204,32 @@ public class BubbleBarView extends FrameLayout { return mBubbleBarBounds; } /** * Set bubble bar relative pivot value for X and Y, applied as a fraction of view width/height * respectively. If the value is not in range of 0 to 1 it will be normalized. * @param x relative X pivot value in range 0..1 * @param y relative Y pivot value in range 0..1 */ public void setRelativePivot(float x, float y) { mRelativePivotX = Float.max(Float.min(x, 1), 0); mRelativePivotY = Float.max(Float.min(y, 1), 0); requestLayout(); } /** * Get current relative pivot for X axis */ public float getRelativePivotX() { return mRelativePivotX; } /** * Get current relative pivot for Y axis */ public float getRelativePivotY() { return mRelativePivotY; } // TODO: (b/280605790) animate it @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { Loading Loading @@ -254,9 +286,9 @@ public class BubbleBarView extends FrameLayout { // where the bubble will end up when the animation ends final float targetX = currentWidth - expandedWidth + expandedX; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(0); bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); Loading Loading @@ -331,6 +363,14 @@ public class BubbleBarView extends FrameLayout { updateArrowForSelected(/* shouldAnimate= */ true); } /** * Sets the dragged bubble view to correctly apply Z order. Dragged view should appear on top */ public void setDraggedBubble(@Nullable BubbleView view) { mDraggedBubbleView = view; requestLayout(); } /** * Update the arrow position to match the selected bubble. * Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +48 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import androidx.annotation.NonNull; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.taskbar.TaskbarActivityContext; Loading Loading @@ -54,6 +56,7 @@ public class BubbleBarViewController { // Initialized in init. private BubbleStashController mBubbleStashController; private BubbleBarController mBubbleBarController; private BubbleDragController mBubbleDragController; private TaskbarStashController mTaskbarStashController; private TaskbarInsetsController mTaskbarInsetsController; private View.OnClickListener mBubbleClickListener; Loading Loading @@ -85,6 +88,7 @@ public class BubbleBarViewController { public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) { mBubbleStashController = bubbleControllers.bubbleStashController; mBubbleBarController = bubbleControllers.bubbleBarController; mBubbleDragController = bubbleControllers.bubbleDragController; mTaskbarStashController = controllers.taskbarStashController; mTaskbarInsetsController = controllers.taskbarInsetsController; Loading @@ -95,6 +99,7 @@ public class BubbleBarViewController { mBubbleBarScale.updateValue(1f); mBubbleClickListener = v -> onBubbleClicked(v); mBubbleBarClickListener = v -> setExpanded(true); mBubbleDragController.setupBubbleBarView(mBarView); mBarView.setOnClickListener(mBubbleBarClickListener); mBarView.addOnLayoutChangeListener((view, i, i1, i2, i3, i4, i5, i6, i7) -> mTaskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged() Loading Loading @@ -268,6 +273,7 @@ public class BubbleBarViewController { if (b != null) { mBarView.addView(b.getView(), 0, new FrameLayout.LayoutParams(mIconSize, mIconSize)); b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); } else { Log.w(TAG, "addBubble, bubble was null!"); } Loading Loading @@ -319,4 +325,46 @@ public class BubbleBarViewController { mBubbleStashController.showBubbleBar(true /* expand the bubbles */); } } /** * Updates the dragged bubble view in the bubble bar view, and notifies SystemUI * that a bubble is being dragged to dismiss. * @param bubbleView dragged bubble view */ public void onDragStart(@NonNull BubbleView bubbleView) { if (bubbleView.getBubble() == null) return; mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ true); mBarView.setDraggedBubble(bubbleView); } /** * Notifies SystemUI to expand the selected bubble when the bubble is released. * @param bubbleView dragged bubble view */ public void onDragRelease(@NonNull BubbleView bubbleView) { if (bubbleView.getBubble() == null) return; mSystemUiProxy.onBubbleDrag(bubbleView.getBubble().getKey(), /* isBeingDragged = */ false); } /** * Removes the dragged bubble view in the bubble bar view */ public void onDragEnd() { mBarView.setDraggedBubble(null); } /** * Called when bubble was dragged into the dismiss target. Notifies System * @param bubble dismissed bubble item */ public void onDismissBubbleWhileDragging(@NonNull BubbleBarItem bubble) { mSystemUiProxy.removeBubble(bubble.getKey()); } /** * Called when bubble stack was dragged into the dismiss target */ public void onDismissAllBubblesWhileDragging() { mSystemUiProxy.removeAllBubbles(); } }