Merge "Set allowTouches after the fling animation end" into rvc-dev am: a08db2de29 am: b7f9d91dc9 am: 2acb42da5f
Change-Id: I88268f97576accc010a0b92a50f4678791623fc3
This commit is contained in:
@@ -815,6 +815,7 @@ public class PipTouchHandler {
|
|||||||
private class DefaultPipTouchGesture extends PipTouchGesture {
|
private class DefaultPipTouchGesture extends PipTouchGesture {
|
||||||
private final Point mStartPosition = new Point();
|
private final Point mStartPosition = new Point();
|
||||||
private final PointF mDelta = new PointF();
|
private final PointF mDelta = new PointF();
|
||||||
|
private boolean mShouldHideMenuAfterFling;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDown(PipTouchState touchState) {
|
public void onDown(PipTouchState touchState) {
|
||||||
@@ -892,21 +893,17 @@ public class PipTouchHandler {
|
|||||||
final float velocity = PointF.length(vel.x, vel.y);
|
final float velocity = PointF.length(vel.x, vel.y);
|
||||||
|
|
||||||
if (touchState.isDragging()) {
|
if (touchState.isDragging()) {
|
||||||
Runnable endAction = null;
|
|
||||||
if (mMenuState != MENU_STATE_NONE) {
|
if (mMenuState != MENU_STATE_NONE) {
|
||||||
// If the menu is still visible, then just poke the menu so that
|
// If the menu is still visible, then just poke the menu so that
|
||||||
// it will timeout after the user stops touching it
|
// it will timeout after the user stops touching it
|
||||||
mMenuController.showMenu(mMenuState, mMotionHelper.getBounds(),
|
mMenuController.showMenu(mMenuState, mMotionHelper.getBounds(),
|
||||||
true /* allowMenuTimeout */, willResizeMenu());
|
true /* allowMenuTimeout */, willResizeMenu());
|
||||||
} else {
|
|
||||||
// If the menu is not visible, then we can still be showing the activity for the
|
|
||||||
// dismiss overlay, so just finish it after the animation completes
|
|
||||||
endAction = mMenuController::hideMenu;
|
|
||||||
}
|
}
|
||||||
|
mShouldHideMenuAfterFling = mMenuState == MENU_STATE_NONE;
|
||||||
|
|
||||||
mMotionHelper.flingToSnapTarget(vel.x, vel.y,
|
mMotionHelper.flingToSnapTarget(vel.x, vel.y,
|
||||||
PipTouchHandler.this::updateDismissFraction /* updateAction */,
|
PipTouchHandler.this::updateDismissFraction /* updateAction */,
|
||||||
endAction /* endAction */);
|
this::flingEndAction /* endAction */);
|
||||||
} else if (mTouchState.isDoubleTap()) {
|
} else if (mTouchState.isDoubleTap()) {
|
||||||
// Expand to fullscreen if this is a double tap
|
// Expand to fullscreen if this is a double tap
|
||||||
// the PiP should be frozen until the transition ends
|
// the PiP should be frozen until the transition ends
|
||||||
@@ -927,6 +924,15 @@ public class PipTouchHandler {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void flingEndAction() {
|
||||||
|
mTouchState.setAllowTouches(true);
|
||||||
|
if (mShouldHideMenuAfterFling) {
|
||||||
|
// If the menu is not visible, then we can still be showing the activity for the
|
||||||
|
// dismiss overlay, so just finish it after the animation completes
|
||||||
|
mMenuController.hideMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user