Deprecate MENU_STATE_CLOSE for PiP menu
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dAZ6Ij0rFaO06Gjy1NX1u3 Bug: 176822698 Test: enter PiP, ensure no "x" button only state and swipe up works Change-Id: I1ba28ecff6607f1ec2848d602119690445c047dc
This commit is contained in:
@@ -60,8 +60,7 @@ public class PhonePipMenuController implements PipMenuController {
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
public static final int MENU_STATE_NONE = 0;
|
||||
public static final int MENU_STATE_CLOSE = 1;
|
||||
public static final int MENU_STATE_FULL = 2;
|
||||
public static final int MENU_STATE_FULL = 1;
|
||||
|
||||
/**
|
||||
* A listener interface to receive notification on changes in PIP.
|
||||
|
||||
@@ -23,7 +23,6 @@ import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTR
|
||||
import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_ICONS;
|
||||
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
|
||||
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_CLOSE;
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_FULL;
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_NONE;
|
||||
|
||||
@@ -203,7 +202,7 @@ public class PipMenuView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
||||
if (action == ACTION_CLICK && mMenuState == MENU_STATE_CLOSE) {
|
||||
if (action == ACTION_CLICK && mMenuState != MENU_STATE_FULL) {
|
||||
mController.showMenu();
|
||||
}
|
||||
return super.performAccessibilityAction(host, action, args);
|
||||
@@ -271,13 +270,12 @@ public class PipMenuView extends FrameLayout {
|
||||
mDismissButton.getAlpha(), 1f);
|
||||
ObjectAnimator resizeAnim = ObjectAnimator.ofFloat(mResizeHandle, View.ALPHA,
|
||||
mResizeHandle.getAlpha(),
|
||||
ENABLE_RESIZE_HANDLE && menuState == MENU_STATE_CLOSE && showResizeHandle
|
||||
? 1f : 0f);
|
||||
ENABLE_RESIZE_HANDLE && showResizeHandle ? 1f : 0f);
|
||||
if (menuState == MENU_STATE_FULL) {
|
||||
mMenuContainerAnimator.playTogether(menuAnim, settingsAnim, dismissAnim,
|
||||
resizeAnim);
|
||||
} else {
|
||||
mMenuContainerAnimator.playTogether(dismissAnim, resizeAnim);
|
||||
mMenuContainerAnimator.playTogether(resizeAnim);
|
||||
}
|
||||
mMenuContainerAnimator.setInterpolator(Interpolators.ALPHA_IN);
|
||||
mMenuContainerAnimator.setDuration(ANIMATION_HIDE_DURATION_MS);
|
||||
@@ -429,7 +427,7 @@ public class PipMenuView extends FrameLayout {
|
||||
|
||||
FrameLayout.LayoutParams expandedLp =
|
||||
(FrameLayout.LayoutParams) expandContainer.getLayoutParams();
|
||||
if (mActions.isEmpty() || menuState == MENU_STATE_CLOSE || menuState == MENU_STATE_NONE) {
|
||||
if (mActions.isEmpty() || menuState == MENU_STATE_NONE) {
|
||||
actionsContainer.setVisibility(View.INVISIBLE);
|
||||
|
||||
// Update the expand container margin to adjust the center of the expand button to
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTI
|
||||
import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_LEFT;
|
||||
import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_NONE;
|
||||
import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_RIGHT;
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_CLOSE;
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_FULL;
|
||||
import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_NONE;
|
||||
import static com.android.wm.shell.pip.phone.PipMenuView.ANIM_TYPE_NONE;
|
||||
@@ -81,7 +80,6 @@ public class PipTouchHandler {
|
||||
|
||||
private final PhonePipMenuController mMenuController;
|
||||
private final AccessibilityManager mAccessibilityManager;
|
||||
private boolean mShowPipMenuOnAnimationEnd = false;
|
||||
|
||||
/**
|
||||
* Whether PIP stash is enabled or not. When enabled, if the user flings toward the edge of the
|
||||
@@ -280,7 +278,6 @@ public class PipTouchHandler {
|
||||
public void onActivityPinned() {
|
||||
mPipDismissTargetHandler.createOrUpdateDismissTarget();
|
||||
|
||||
mShowPipMenuOnAnimationEnd = true;
|
||||
mPipResizeGestureHandler.onActivityPinned();
|
||||
mFloatingContentCoordinator.onContentAdded(mMotionHelper);
|
||||
}
|
||||
@@ -304,13 +301,6 @@ public class PipTouchHandler {
|
||||
// Set the initial bounds as the user resize bounds.
|
||||
mPipResizeGestureHandler.setUserResizeBounds(mPipBoundsState.getBounds());
|
||||
}
|
||||
|
||||
if (mShowPipMenuOnAnimationEnd) {
|
||||
mMenuController.showMenu(MENU_STATE_CLOSE, mPipBoundsState.getBounds(),
|
||||
true /* allowMenuTimeout */, false /* willResizeMenu */,
|
||||
shouldShowResizeHandle());
|
||||
mShowPipMenuOnAnimationEnd = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onConfigurationChanged() {
|
||||
|
||||
Reference in New Issue
Block a user