Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +8 −13 Original line number Diff line number Diff line Loading @@ -576,19 +576,16 @@ public class BubbleStackView extends FrameLayout mBubbleContainer.setActiveController(mStackAnimationController); hideFlyoutImmediate(); if (!mPositioner.showingInTaskbar()) { // Also, save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack( mMagneticTarget); mMagnetizedObject.setMagnetListener(mStackMagnetListener); } else { if (mPositioner.showingInTaskbar()) { // In taskbar, the stack isn't draggable so we shouldn't dispatch touch events. mMagnetizedObject = null; } // Also, save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack(mMagneticTarget); } else { // Save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack(); mMagnetizedObject.clearAllTargets(); mMagnetizedObject.addTarget(mMagneticTarget); mMagnetizedObject.setMagnetListener(mStackMagnetListener); } mIsDraggingStack = true; Loading Loading @@ -881,7 +878,6 @@ public class BubbleStackView extends FrameLayout mRelativeStackPositionBeforeRotation = null; } setUpDismissView(); if (mIsExpanded) { // Re-draw bubble row and pointer for new orientation. beforeExpandedViewAnimation(); Loading Loading @@ -1043,10 +1039,9 @@ public class BubbleStackView extends FrameLayout contentResolver, "bubble_dismiss_radius", mBubbleSize * 2 /* default */); // Save the MagneticTarget instance for the newly set up view - we'll add this to the // MagnetizedObjects. // MagnetizedObjects when the dismiss view gets shown. mMagneticTarget = new MagnetizedObject.MagneticTarget( mDismissView.getCircle(), dismissRadius); mBubbleContainer.bringToFront(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java +2 −5 Original line number Diff line number Diff line Loading @@ -1024,11 +1024,9 @@ public class StackAnimationController extends } /** * Returns the {@link MagnetizedObject} instance for the bubble stack, with the provided * {@link MagnetizedObject.MagneticTarget} added as a target. * Returns the {@link MagnetizedObject} instance for the bubble stack. */ public MagnetizedObject<StackAnimationController> getMagnetizedStack( MagnetizedObject.MagneticTarget target) { public MagnetizedObject<StackAnimationController> getMagnetizedStack() { if (mMagnetizedStack == null) { mMagnetizedStack = new MagnetizedObject<StackAnimationController>( mLayout.getContext(), Loading @@ -1053,7 +1051,6 @@ public class StackAnimationController extends loc[1] = (int) mStackPosition.y; } }; mMagnetizedStack.addTarget(target); mMagnetizedStack.setHapticsEnabled(true); mMagnetizedStack.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/magnetictarget/MagnetizedObject.kt +7 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,13 @@ abstract class MagnetizedObject<T : Any>( associatedTargets.remove(target) } /** * Removes all associated targets from this object. */ fun clearAllTargets() { associatedTargets.clear() } /** * Provide this method with all motion events that move the magnetized object. If the * location of the motion events moves within the magnetic field of a target, or indicate a Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +8 −13 Original line number Diff line number Diff line Loading @@ -576,19 +576,16 @@ public class BubbleStackView extends FrameLayout mBubbleContainer.setActiveController(mStackAnimationController); hideFlyoutImmediate(); if (!mPositioner.showingInTaskbar()) { // Also, save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack( mMagneticTarget); mMagnetizedObject.setMagnetListener(mStackMagnetListener); } else { if (mPositioner.showingInTaskbar()) { // In taskbar, the stack isn't draggable so we shouldn't dispatch touch events. mMagnetizedObject = null; } // Also, save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack(mMagneticTarget); } else { // Save the magnetized stack so we can dispatch touch events to it. mMagnetizedObject = mStackAnimationController.getMagnetizedStack(); mMagnetizedObject.clearAllTargets(); mMagnetizedObject.addTarget(mMagneticTarget); mMagnetizedObject.setMagnetListener(mStackMagnetListener); } mIsDraggingStack = true; Loading Loading @@ -881,7 +878,6 @@ public class BubbleStackView extends FrameLayout mRelativeStackPositionBeforeRotation = null; } setUpDismissView(); if (mIsExpanded) { // Re-draw bubble row and pointer for new orientation. beforeExpandedViewAnimation(); Loading Loading @@ -1043,10 +1039,9 @@ public class BubbleStackView extends FrameLayout contentResolver, "bubble_dismiss_radius", mBubbleSize * 2 /* default */); // Save the MagneticTarget instance for the newly set up view - we'll add this to the // MagnetizedObjects. // MagnetizedObjects when the dismiss view gets shown. mMagneticTarget = new MagnetizedObject.MagneticTarget( mDismissView.getCircle(), dismissRadius); mBubbleContainer.bringToFront(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java +2 −5 Original line number Diff line number Diff line Loading @@ -1024,11 +1024,9 @@ public class StackAnimationController extends } /** * Returns the {@link MagnetizedObject} instance for the bubble stack, with the provided * {@link MagnetizedObject.MagneticTarget} added as a target. * Returns the {@link MagnetizedObject} instance for the bubble stack. */ public MagnetizedObject<StackAnimationController> getMagnetizedStack( MagnetizedObject.MagneticTarget target) { public MagnetizedObject<StackAnimationController> getMagnetizedStack() { if (mMagnetizedStack == null) { mMagnetizedStack = new MagnetizedObject<StackAnimationController>( mLayout.getContext(), Loading @@ -1053,7 +1051,6 @@ public class StackAnimationController extends loc[1] = (int) mStackPosition.y; } }; mMagnetizedStack.addTarget(target); mMagnetizedStack.setHapticsEnabled(true); mMagnetizedStack.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/magnetictarget/MagnetizedObject.kt +7 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,13 @@ abstract class MagnetizedObject<T : Any>( associatedTargets.remove(target) } /** * Removes all associated targets from this object. */ fun clearAllTargets() { associatedTargets.clear() } /** * Provide this method with all motion events that move the magnetized object. If the * location of the motion events moves within the magnetic field of a target, or indicate a Loading