Merge "Finish the recents animation upon home rotation" into sc-dev am: dc2be3d8a2 am: 8f324ae67a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14613421

Change-Id: I92d632a258d392ac3fc9c5d103b256eddfdcb0ee
This commit is contained in:
Tracy Zhou
2021-05-19 17:49:37 +00:00
committed by Automerger Merge Worker
@@ -388,6 +388,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
private final TaskOverlayFactory mTaskOverlayFactory;
private int mOrientation;
protected boolean mDisallowScrollToClearAll;
private boolean mOverlayEnabled;
protected boolean mFreezeViewVisibility;
@@ -580,6 +582,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
.getDimensionPixelSize(R.dimen.recents_fast_fling_velocity);
mModel = RecentsModel.INSTANCE.get(context);
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
mOrientation = getResources().getConfiguration().orientation;
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
.inflate(R.layout.overview_clear_all_button, this, false);
@@ -2574,6 +2577,18 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
switchToScreenshot(
() -> finishRecentsAnimation(true /* toRecents */,
this::onConfigurationChangedInternal));
mEnableDrawingLiveTile = false;
} else {
onConfigurationChangedInternal();
}
mOrientation = newConfig.orientation;
}
private void onConfigurationChangedInternal() {
final int rotation = mActivity.getDisplay().getRotation();
if (mOrientationState.setRecentsRotation(rotation)) {
updateOrientationHandler();