Merge "Clean up dismiss target when last activity is unpinned." into oc-dr1-dev
am: 65a3b2ccc4
Change-Id: I576f611e4a1a6567e7cd2e80b4f5575ba99e2f4d
This commit is contained in:
@@ -93,6 +93,7 @@ public class PipManager implements BasePipManager {
|
||||
ComponentName topPipActivity = PipUtils.getTopPinnedActivity(mContext,
|
||||
mActivityManager);
|
||||
mMenuController.hideMenu();
|
||||
mTouchHandler.onActivityUnpinned(topPipActivity);
|
||||
mNotificationController.onActivityUnpinned(topPipActivity);
|
||||
|
||||
SystemServicesProxy.getInstance(mContext).setPipVisibility(topPipActivity != null);
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
import android.app.IActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
@@ -116,7 +117,7 @@ public class PipTouchHandler {
|
||||
};
|
||||
|
||||
// Behaviour states
|
||||
private int mMenuState;
|
||||
private int mMenuState = MENU_STATE_NONE;
|
||||
private boolean mIsMinimized;
|
||||
private boolean mIsImeShowing;
|
||||
private int mImeHeight;
|
||||
@@ -212,16 +213,17 @@ public class PipTouchHandler {
|
||||
}
|
||||
|
||||
public void onActivityPinned() {
|
||||
// Reset some states once we are pinned
|
||||
mMenuState = MENU_STATE_NONE;
|
||||
|
||||
if (mIsMinimized) {
|
||||
setMinimizedStateInternal(false);
|
||||
}
|
||||
cleanUpDismissTarget();
|
||||
cleanUp();
|
||||
mShowPipMenuOnAnimationEnd = true;
|
||||
}
|
||||
|
||||
public void onActivityUnpinned(ComponentName topPipActivity) {
|
||||
if (topPipActivity == null) {
|
||||
// Clean up state after the last PiP activity is removed
|
||||
cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void onPinnedStackAnimationEnded() {
|
||||
// Always synchronize the motion helper bounds once PiP animations finish
|
||||
mMotionHelper.synchronizePinnedStackBounds();
|
||||
@@ -729,6 +731,16 @@ public class PipTouchHandler {
|
||||
mDismissViewController.destroyDismissTarget();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets some states related to the touch handling.
|
||||
*/
|
||||
private void cleanUp() {
|
||||
if (mIsMinimized) {
|
||||
setMinimizedStateInternal(false);
|
||||
}
|
||||
cleanUpDismissTarget();
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw, String prefix) {
|
||||
final String innerPrefix = prefix + " ";
|
||||
pw.println(prefix + TAG);
|
||||
|
||||
Reference in New Issue
Block a user