Merge "Finish the recents animation upon home rotation" into sc-dev
This commit is contained in:
@@ -388,6 +388,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
|
|
||||||
private final TaskOverlayFactory mTaskOverlayFactory;
|
private final TaskOverlayFactory mTaskOverlayFactory;
|
||||||
|
|
||||||
|
private int mOrientation;
|
||||||
|
|
||||||
protected boolean mDisallowScrollToClearAll;
|
protected boolean mDisallowScrollToClearAll;
|
||||||
private boolean mOverlayEnabled;
|
private boolean mOverlayEnabled;
|
||||||
protected boolean mFreezeViewVisibility;
|
protected boolean mFreezeViewVisibility;
|
||||||
@@ -581,6 +583,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
.getDimensionPixelSize(R.dimen.recents_fast_fling_velocity);
|
.getDimensionPixelSize(R.dimen.recents_fast_fling_velocity);
|
||||||
mModel = RecentsModel.INSTANCE.get(context);
|
mModel = RecentsModel.INSTANCE.get(context);
|
||||||
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
|
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
|
||||||
|
mOrientation = getResources().getConfiguration().orientation;
|
||||||
|
|
||||||
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
|
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
|
||||||
.inflate(R.layout.overview_clear_all_button, this, false);
|
.inflate(R.layout.overview_clear_all_button, this, false);
|
||||||
@@ -2612,6 +2615,18 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
@Override
|
@Override
|
||||||
protected void onConfigurationChanged(Configuration newConfig) {
|
protected void onConfigurationChanged(Configuration newConfig) {
|
||||||
super.onConfigurationChanged(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();
|
final int rotation = mActivity.getDisplay().getRotation();
|
||||||
if (mOrientationState.setRecentsRotation(rotation)) {
|
if (mOrientationState.setRecentsRotation(rotation)) {
|
||||||
updateOrientationHandler();
|
updateOrientationHandler();
|
||||||
|
|||||||
Reference in New Issue
Block a user