Fallback to predefined orientation handler if recents view isn't available
Change-Id: Iaed42fb9ef598d65e1cf2d166cc343f888352d47
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
index 65fba08..ce67457 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
@@ -41,6 +41,9 @@
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
+import com.android.launcher3.touch.LandscapePagedViewHandler;
+import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.touch.PortraitPagedViewHandler;
import com.android.launcher3.util.ObjectWrapper;
import com.android.quickstep.BaseActivityInterface.HomeAnimationFactory;
import com.android.quickstep.GestureState.GestureEndTarget;
@@ -470,8 +473,13 @@
HomeAnimationFactory factory = new HomeAnimationFactory() {
@Override
public RectF getWindowTargetRect() {
+ PagedOrientationHandler orientationHandler = mRecentsView != null
+ ? mRecentsView.getPagedOrientationHandler()
+ : (mDp.isLandscape
+ ? new LandscapePagedViewHandler()
+ : new PortraitPagedViewHandler());
return HomeAnimationFactory
- .getDefaultWindowTargetRect(mRecentsView.getPagedOrientationHandler(), mDp);
+ .getDefaultWindowTargetRect(orientationHandler, mDp);
}
@Override