Let the bubble bar handle gestures over the bubble bar.
This change introduces a motion event flag to signal that the gesture is being originated over the bubble bar (similar to the nav bar gesture flag). Downstream consumers use this flag to ignore the event in order to allow the bubble bar to handle it. The black screen in b/293348900 seemed to be related to the recents shell transition closing the app that was in the foreground before swiping on the bubble bar handle. Not sure why it ended up with a black screen, but this change avoids starting the recents transition entirely. Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/BSxLROoflr1i2yy0v6Y4G Fixes: 294421126 Bug: 293348900 Test: Manual: - Add bubble to the bubble bar - Swipe up over the bubble bar - Observe that the bubble bar expands - Launch application - Swipe up on the bubble bar handle - Observe that the bubble bar expands Change-Id: Iea15829de97edb6bfbfb7007388865230faaf736
This commit is contained in:
+19
@@ -24,6 +24,7 @@ import android.animation.ValueAnimator;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
|
||||
@@ -268,4 +269,22 @@ public class BubbleStashedHandleViewController {
|
||||
});
|
||||
return revealAnim;
|
||||
}
|
||||
|
||||
/** Checks that the stash handle is visible and that the motion event is within bounds. */
|
||||
public boolean isEventOverHandle(MotionEvent ev) {
|
||||
if (mStashedHandleView.getVisibility() != VISIBLE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// the bounds of the handle only include the visible part, so we check that the Y coordinate
|
||||
// is anywhere within the stashed taskbar height.
|
||||
int top = mActivity.getDeviceProfile().heightPx - mStashedTaskbarHeight;
|
||||
|
||||
return (int) ev.getRawY() >= top && containsX((int) ev.getRawX());
|
||||
}
|
||||
|
||||
/** Checks if the given x coordinate is within the stashed handle bounds. */
|
||||
public boolean containsX(int x) {
|
||||
return x >= mStashedHandleBounds.left && x <= mStashedHandleBounds.right;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user