Merge "PiP: Move resetting mAllowTouches into scope of MenuView" into sc-dev

This commit is contained in:
Ben Lin
2021-05-18 17:41:23 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 14 deletions

View File

@@ -173,13 +173,6 @@ public class PhonePipMenuController implements PipMenuController {
detachPipMenuView(); detachPipMenuView();
} }
void onPinnedStackAnimationEnded() {
if (isMenuVisible()) {
mPipMenuView.onPipAnimationEnded();
}
}
private void attachPipMenuView() { private void attachPipMenuView() {
// In case detach was not called (e.g. PIP unexpectedly closed) // In case detach was not called (e.g. PIP unexpectedly closed)
if (mPipMenuView != null) { if (mPipMenuView != null) {

View File

@@ -36,7 +36,6 @@ import android.content.res.Configuration;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.IBinder; import android.os.IBinder;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle; import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
import android.util.Log; import android.util.Log;
@@ -606,7 +605,6 @@ public class PipController implements PipTransitionController.PipTransitionCallb
// Re-enable touches after the animation completes // Re-enable touches after the animation completes
mTouchHandler.setTouchEnabled(true); mTouchHandler.setTouchEnabled(true);
mTouchHandler.onPinnedStackAnimationEnded(direction); mTouchHandler.onPinnedStackAnimationEnded(direction);
mMenuController.onPinnedStackAnimationEnded();
} }
private void updateMovementBounds(@Nullable Rect toBounds, boolean fromRotation, private void updateMovementBounds(@Nullable Rect toBounds, boolean fromRotation,

View File

@@ -40,7 +40,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
@@ -279,11 +278,17 @@ public class PipMenuView extends FrameLayout {
mMenuContainerAnimator.addListener(new AnimatorListenerAdapter() { mMenuContainerAnimator.addListener(new AnimatorListenerAdapter() {
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
mAllowTouches = true;
notifyMenuStateChangeFinish(menuState); notifyMenuStateChangeFinish(menuState);
if (allowMenuTimeout) { if (allowMenuTimeout) {
repostDelayedHide(INITIAL_DISMISS_DELAY); repostDelayedHide(INITIAL_DISMISS_DELAY);
} }
} }
@Override
public void onAnimationCancel(Animator animation) {
mAllowTouches = true;
}
}); });
if (withDelay) { if (withDelay) {
// starts the menu container animation after window expansion is completed // starts the menu container animation after window expansion is completed
@@ -326,10 +331,6 @@ public class PipMenuView extends FrameLayout {
cancelDelayedHide(); cancelDelayedHide();
} }
void onPipAnimationEnded() {
mAllowTouches = true;
}
void updateMenuLayout(Rect bounds) { void updateMenuLayout(Rect bounds) {
mPipMenuIconsAlgorithm.onBoundsChanged(bounds); mPipMenuIconsAlgorithm.onBoundsChanged(bounds);
} }