Revert "Bubble bar drag to dismiss"

Revert submission 23879277-bubble_bar_dismiss

Reason for revert: issues with touch

Reverted changes: /q/submissionid:23879277-bubble_bar_dismiss

Change-Id: Ib67d6a72fbfd8819f379f46e9e9100f179977b44
This commit is contained in:
Mady Mellor
2023-07-12 22:27:17 +00:00
committed by Android (Google) Code Review
parent 4767b38a9b
commit 9b7fdb5c80
5 changed files with 4 additions and 77 deletions

View File

@@ -1049,20 +1049,6 @@ public class BubbleController implements ConfigurationChangeListener,
mBubbleData.setExpanded(false /* expanded */);
}
/**
* Update expanded state when a single bubble is dragged in Launcher.
* Will be called only when bubble bar is expanded.
* @param bubbleKey key of the bubble to collapse/expand
* @param collapse whether to collapse or expand
*/
public void collapseWhileDragging(String bubbleKey, boolean collapse) {
if (mBubbleData.getSelectedBubble() != null
&& mBubbleData.getSelectedBubble().getKey().equals(bubbleKey)) {
// Should collapse/expand only if equals to selected bubble.
mBubbleBarViewCallback.expansionChanged(/* isExpanded = */ !collapse);
}
}
@VisibleForTesting
public boolean isBubbleNotificationSuppressedFromShade(String key, String groupKey) {
boolean isSuppressedBubble = (mBubbleData.hasAnyBubbleWithKey(key)
@@ -1448,17 +1434,6 @@ public class BubbleController implements ConfigurationChangeListener,
}
}
/**
* Removes all the bubbles.
* <p>
* Must be called from the main thread.
*/
@VisibleForTesting
@MainThread
public void removeAllBubbles(@Bubbles.DismissReason int reason) {
mBubbleData.dismissAll(reason);
}
private void onEntryAdded(BubbleEntry entry) {
if (canLaunchInTaskView(mContext, entry)) {
updateBubble(entry);
@@ -2120,25 +2095,14 @@ public class BubbleController implements ConfigurationChangeListener,
}
@Override
public void removeBubble(String key) {
mMainExecutor.execute(
() -> mController.removeBubble(key, Bubbles.DISMISS_USER_GESTURE));
}
@Override
public void removeAllBubbles() {
mMainExecutor.execute(() -> mController.removeAllBubbles(Bubbles.DISMISS_USER_GESTURE));
public void removeBubble(String key, int reason) {
// TODO (b/271466616) allow removals from launcher
}
@Override
public void collapseBubbles() {
mMainExecutor.execute(() -> mController.collapseStack());
}
@Override
public void collapseWhileDragging(String bubbleKey, boolean collapse) {
mMainExecutor.execute(() -> mController.collapseWhileDragging(bubbleKey, collapse));
}
}
private class BubblesImpl implements Bubbles {

View File

@@ -32,12 +32,8 @@ interface IBubbles {
oneway void showBubble(in String key, in int bubbleBarXCoordinate,
in int bubbleBarYCoordinate) = 3;
oneway void removeBubble(in String key) = 4;
oneway void removeBubble(in String key, in int reason) = 4;
oneway void removeAllBubbles() = 5;
oneway void collapseBubbles() = 6;
oneway void collapseWhileDragging(in String key, in boolean collapse) = 7;
oneway void collapseBubbles() = 5;
}

View File

@@ -215,14 +215,6 @@ public class BubbleBarAnimationHelper {
mExpandedViewAlphaAnimator.reverse();
}
/**
* Cancel current animations
*/
public void cancelAnimations() {
PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel();
mExpandedViewAlphaAnimator.cancel();
}
private void updateExpandedView() {
if (mExpandedBubble == null || mExpandedBubble.getBubbleBarExpandedView() == null) {
Log.w(TAG, "Trying to update the expanded view without a bubble");

View File

@@ -150,12 +150,6 @@ public class BubbleBarLayerView extends FrameLayout
mExpandedView = null;
}
if (mExpandedView == null) {
if (expandedView.getParent() != null) {
// Expanded view might be animating collapse and is still attached
// Cancel current animations and remove from parent
mAnimationHelper.cancelAnimations();
removeView(expandedView);
}
mExpandedBubble = b;
mExpandedView = expandedView;
boolean isOverflowExpanded = b.getKey().equals(BubbleOverflow.KEY);

View File

@@ -78,24 +78,6 @@ abstract class RelativeTouchListener : View.OnTouchListener {
velY: Float
)
/**
* Called when an ACTION_CANCEL event is received for the given view. This signals that the
* current gesture has been aborted.
*
* @param viewInitialX The view's translationX value when this touch gesture started.
* @param viewInitialY The view's translationY value when this touch gesture started.
* @param dx Horizontal distance covered since the initial ACTION_DOWN event, in pixels.
* @param dy Vertical distance covered since the initial ACTION_DOWN event, in pixels.
*/
open fun onCancel(
v: View,
ev: MotionEvent,
viewInitialX: Float,
viewInitialY: Float,
dx: Float,
dy: Float
) {}
/** The raw coordinates of the last ACTION_DOWN event. */
private val touchDown = PointF()
@@ -164,7 +146,6 @@ abstract class RelativeTouchListener : View.OnTouchListener {
}
MotionEvent.ACTION_CANCEL -> {
onCancel(v, ev, viewPositionOnTouchDown.x, viewPositionOnTouchDown.y, dx, dy)
v.handler.removeCallbacksAndMessages(null)
velocityTracker.clear()
movedEnough = false