Merge "Allow touches through Taskbar when dragging to home screen" into sc-dev am: 73cc9a5053

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13817250

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If62d6bddc24f5ad3295a29bb1498d4faa8b787bc
This commit is contained in:
Tony Wickham authored and Automerger Merge Worker committed 2021-03-10 21:33:08 +00:00
commit ca0ed4dc6e
1 file changed
+7 -2
@@ -83,10 +83,15 @@ public class TaskbarContainerView extends BaseDragLayer<TaskbarActivityContext>
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);