Merge "Collapse the stack on clicks rather than on down" into sc-dev am: fd4a4a3ee5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14850318 Change-Id: If46c3cc3c71058511b55c3abc99375ddda1d354a
This commit is contained in:
@@ -290,27 +290,6 @@ public class BubbleExpandedView extends LinearLayout {
|
|||||||
applyThemeAttrs();
|
applyThemeAttrs();
|
||||||
|
|
||||||
setClipToPadding(false);
|
setClipToPadding(false);
|
||||||
setOnTouchListener((view, motionEvent) -> {
|
|
||||||
if (mTaskView == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Rect avBounds = new Rect();
|
|
||||||
mTaskView.getBoundsOnScreen(avBounds);
|
|
||||||
|
|
||||||
// Consume and ignore events on the expanded view padding that are within the
|
|
||||||
// ActivityView's vertical bounds. These events are part of a back gesture, and so they
|
|
||||||
// should not collapse the stack (which all other touches on areas around the AV would
|
|
||||||
// do).
|
|
||||||
if (motionEvent.getRawY() >= avBounds.top
|
|
||||||
&& motionEvent.getRawY() <= avBounds.bottom
|
|
||||||
&& (motionEvent.getRawX() < avBounds.left
|
|
||||||
|| motionEvent.getRawX() > avBounds.right)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// BubbleStackView is forced LTR, but we want to respect the locale for expanded view layout
|
// BubbleStackView is forced LTR, but we want to respect the locale for expanded view layout
|
||||||
// so the Manage button appears on the right.
|
// so the Manage button appears on the right.
|
||||||
|
|||||||
@@ -901,20 +901,16 @@ public class BubbleStackView extends FrameLayout
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// If the stack itself is touched, it means none of its touchable views (bubbles, flyouts,
|
// If the stack itself is clicked, it means none of its touchable views (bubbles, flyouts,
|
||||||
// ActivityViews, etc.) were touched. Collapse the stack if it's expanded.
|
// TaskView, etc.) were touched. Collapse the stack if it's expanded.
|
||||||
setOnTouchListener((view, ev) -> {
|
setOnClickListener(view -> {
|
||||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
if (mShowingManage) {
|
||||||
if (mShowingManage) {
|
showManageMenu(false /* show */);
|
||||||
showManageMenu(false /* show */);
|
} else if (mStackEduView != null && mStackEduView.getVisibility() == VISIBLE) {
|
||||||
} else if (mStackEduView != null && mStackEduView.getVisibility() == VISIBLE) {
|
mStackEduView.hide(false);
|
||||||
mStackEduView.hide(false);
|
} else if (mBubbleData.isExpanded()) {
|
||||||
} else if (mBubbleData.isExpanded()) {
|
mBubbleData.setExpanded(false);
|
||||||
mBubbleData.setExpanded(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
animate()
|
animate()
|
||||||
|
|||||||
Reference in New Issue
Block a user