Loading quickstep/src/com/android/quickstep/ActivityControlHelper.java +27 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.quickstep.util.RemoteAnimationProvider; import com.android.quickstep.views.LauncherLayoutListener; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; Loading Loading @@ -92,6 +93,10 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { @UiThread boolean switchToRecentsIfVisible(); Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target); boolean shouldMinimizeSplitScreen(); /** * @return {@code true} if recents activity should be started immediately on touchDown, * {@code false} if it should deferred until some threshold is crossed. Loading Loading @@ -260,6 +265,16 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { public boolean deferStartingActivity(int downHitTarget) { return downHitTarget == HIT_TARGET_BACK; } @Override public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { return homeBounds; } @Override public boolean shouldMinimizeSplitScreen() { return true; } } class FallbackActivityControllerHelper implements ActivityControlHelper<RecentsActivity> { Loading Loading @@ -377,6 +392,18 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { // Always defer starting the activity when using fallback return true; } @Override public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { // TODO: Remove this once b/77875376 is fixed return target.sourceContainerBounds; } @Override public boolean shouldMinimizeSplitScreen() { // TODO: Remove this once b/77875376 is fixed return false; } } interface LayoutListener { Loading quickstep/src/com/android/quickstep/RecentsActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ public class RecentsActivity extends BaseDraggingActivity { @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) { mOldConfig.setTo(newConfig); onHandleConfigChanged(); super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig); } Loading Loading @@ -129,7 +128,8 @@ public class RecentsActivity extends BaseDraggingActivity { InvariantDeviceProfile idp = appState == null ? new InvariantDeviceProfile(this) : appState.getInvariantDeviceProfile(); DeviceProfile dp = idp.getDeviceProfile(this); mDeviceProfile = dp.getMultiWindowProfile(this, mRecentsRootView.getLastKnownSize()); mDeviceProfile = mRecentsRootView == null ? dp.copy(this) : dp.getMultiWindowProfile(this, mRecentsRootView.getLastKnownSize()); } else { // If we are reusing the Invariant device profile, make a copy. mDeviceProfile = appState == null Loading quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +9 −5 Original line number Diff line number Diff line Loading @@ -459,7 +459,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { // TODO: This logic is spartanic! boolean passedThreshold = shift > 0.12f; mRecentsAnimationWrapper.setAnimationTargetsBehindSystemBars(!passedThreshold); mRecentsAnimationWrapper.setSplitScreenMinimizedForTransaction(passedThreshold); if (mActivityControlHelper.shouldMinimizeSplitScreen()) { mRecentsAnimationWrapper .setSplitScreenMinimizedForTransaction(passedThreshold); } } }; if (Looper.getMainLooper() == Looper.myLooper()) { Loading @@ -478,15 +481,16 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { for (RemoteAnimationTargetCompat target : apps) { if (target.mode == MODE_CLOSING) { DeviceProfile dp = LauncherAppState.getIDP(mContext).getDeviceProfile(mContext); final Rect homeStackBounds; final Rect overviewStackBounds; if (minimizedHomeBounds != null) { homeStackBounds = minimizedHomeBounds; overviewStackBounds = mActivityControlHelper .getOverviewWindowBounds(minimizedHomeBounds, target); dp = dp.getMultiWindowProfile(mContext, new Point(minimizedHomeBounds.width(), minimizedHomeBounds.height())); dp.updateInsets(homeContentInsets); } else { homeStackBounds = new Rect(0, 0, dp.widthPx, dp.heightPx); overviewStackBounds = new Rect(0, 0, dp.widthPx, dp.heightPx); // TODO: Workaround for an existing issue where the home content insets are // not valid immediately after rotation, just use the stable insets for now Rect insets = new Rect(); Loading @@ -495,7 +499,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { dp.updateInsets(insets); } mClipAnimationHelper.updateSource(homeStackBounds, target); mClipAnimationHelper.updateSource(overviewStackBounds, target); initTransitionEndpoints(dp); } } Loading quickstep/src/com/android/quickstep/fallback/RecentsRootView.java +1 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class RecentsRootView extends BaseDragLayer<RecentsActivity> { } public void dispatchInsets() { mActivity.getDeviceProfile().updateInsets(mInsets); super.setInsets(mInsets); } } No newline at end of file src/com/android/launcher3/LauncherRootView.java +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ public class LauncherRootView extends InsettableFrameLayout { } public void dispatchInsets() { mLauncher.getDeviceProfile().updateInsets(mInsets); super.setInsets(mInsets); } Loading Loading
quickstep/src/com/android/quickstep/ActivityControlHelper.java +27 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.quickstep.util.RemoteAnimationProvider; import com.android.quickstep.views.LauncherLayoutListener; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; Loading Loading @@ -92,6 +93,10 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { @UiThread boolean switchToRecentsIfVisible(); Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target); boolean shouldMinimizeSplitScreen(); /** * @return {@code true} if recents activity should be started immediately on touchDown, * {@code false} if it should deferred until some threshold is crossed. Loading Loading @@ -260,6 +265,16 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { public boolean deferStartingActivity(int downHitTarget) { return downHitTarget == HIT_TARGET_BACK; } @Override public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { return homeBounds; } @Override public boolean shouldMinimizeSplitScreen() { return true; } } class FallbackActivityControllerHelper implements ActivityControlHelper<RecentsActivity> { Loading Loading @@ -377,6 +392,18 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { // Always defer starting the activity when using fallback return true; } @Override public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { // TODO: Remove this once b/77875376 is fixed return target.sourceContainerBounds; } @Override public boolean shouldMinimizeSplitScreen() { // TODO: Remove this once b/77875376 is fixed return false; } } interface LayoutListener { Loading
quickstep/src/com/android/quickstep/RecentsActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ public class RecentsActivity extends BaseDraggingActivity { @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) { mOldConfig.setTo(newConfig); onHandleConfigChanged(); super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig); } Loading Loading @@ -129,7 +128,8 @@ public class RecentsActivity extends BaseDraggingActivity { InvariantDeviceProfile idp = appState == null ? new InvariantDeviceProfile(this) : appState.getInvariantDeviceProfile(); DeviceProfile dp = idp.getDeviceProfile(this); mDeviceProfile = dp.getMultiWindowProfile(this, mRecentsRootView.getLastKnownSize()); mDeviceProfile = mRecentsRootView == null ? dp.copy(this) : dp.getMultiWindowProfile(this, mRecentsRootView.getLastKnownSize()); } else { // If we are reusing the Invariant device profile, make a copy. mDeviceProfile = appState == null Loading
quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +9 −5 Original line number Diff line number Diff line Loading @@ -459,7 +459,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { // TODO: This logic is spartanic! boolean passedThreshold = shift > 0.12f; mRecentsAnimationWrapper.setAnimationTargetsBehindSystemBars(!passedThreshold); mRecentsAnimationWrapper.setSplitScreenMinimizedForTransaction(passedThreshold); if (mActivityControlHelper.shouldMinimizeSplitScreen()) { mRecentsAnimationWrapper .setSplitScreenMinimizedForTransaction(passedThreshold); } } }; if (Looper.getMainLooper() == Looper.myLooper()) { Loading @@ -478,15 +481,16 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { for (RemoteAnimationTargetCompat target : apps) { if (target.mode == MODE_CLOSING) { DeviceProfile dp = LauncherAppState.getIDP(mContext).getDeviceProfile(mContext); final Rect homeStackBounds; final Rect overviewStackBounds; if (minimizedHomeBounds != null) { homeStackBounds = minimizedHomeBounds; overviewStackBounds = mActivityControlHelper .getOverviewWindowBounds(minimizedHomeBounds, target); dp = dp.getMultiWindowProfile(mContext, new Point(minimizedHomeBounds.width(), minimizedHomeBounds.height())); dp.updateInsets(homeContentInsets); } else { homeStackBounds = new Rect(0, 0, dp.widthPx, dp.heightPx); overviewStackBounds = new Rect(0, 0, dp.widthPx, dp.heightPx); // TODO: Workaround for an existing issue where the home content insets are // not valid immediately after rotation, just use the stable insets for now Rect insets = new Rect(); Loading @@ -495,7 +499,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { dp.updateInsets(insets); } mClipAnimationHelper.updateSource(homeStackBounds, target); mClipAnimationHelper.updateSource(overviewStackBounds, target); initTransitionEndpoints(dp); } } Loading
quickstep/src/com/android/quickstep/fallback/RecentsRootView.java +1 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class RecentsRootView extends BaseDragLayer<RecentsActivity> { } public void dispatchInsets() { mActivity.getDeviceProfile().updateInsets(mInsets); super.setInsets(mInsets); } } No newline at end of file
src/com/android/launcher3/LauncherRootView.java +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ public class LauncherRootView extends InsettableFrameLayout { } public void dispatchInsets() { mLauncher.getDeviceProfile().updateInsets(mInsets); super.setInsets(mInsets); } Loading