Allow touches through Taskbar when dragging to home screen
Setting visibleInsets to (almost) empty ensures the drag
events get sent to launcher.
Test: Drag a taskbar item on home, ensure it moves when
events are within the taskbar insets
Bug: 182079330
Bug: 171917176
Change-Id: Ida6a4a94a3fd2927d18245f45ed3e8d1701b9833
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java
index 1e5e3e7..528f43e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java
@@ -83,10 +83,15 @@
private ViewTreeObserverWrapper.OnComputeInsetsListener createTaskbarInsetsComputer() {
return insetsInfo -> {
- if (getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD) {
- // We're invisible, let touches pass through us.
+ if (getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD
+ || mTaskbarView.isDraggingItem()) {
+ // We're invisible or dragging out of taskbar, let touches pass through us.
insetsInfo.touchableRegion.setEmpty();
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
+ // TODO(b/182234653): Shouldn't need to do this, but for the meantime, reporting
+ // that visibleInsets is empty allows DragEvents through. Setting them as completely
+ // empty reverts to default behavior, so set 1 px instead.
+ insetsInfo.visibleInsets.set(0, 0, 0, 1);
} else {
// We're visible again, accept touches anywhere in our bounds.
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_FRAME);