@@ -553,6 +553,8 @@ public Float get(RecentsView view) {
553
553
private int mKeyboardTaskFocusIndex = INVALID_PAGE ;
554
554
555
555
private float mScrollScale = 1f ;
556
+
557
+ private boolean mIsLandScape ;
556
558
557
559
/**
558
560
* TODO: Call reloadIdNeeded in onTaskStackChanged.
@@ -953,9 +955,6 @@ protected void dispatchDraw(Canvas canvas) {
953
955
}
954
956
super .dispatchDraw (canvas );
955
957
}
956
- if (mEnableDrawingLiveTile && mRemoteTargetHandles != null ) {
957
- redrawLiveTile ();
958
- }
959
958
}
960
959
961
960
private float getUndampedOverScrollShift () {
@@ -1992,21 +1991,7 @@ public void resetTaskVisuals() {
1992
1991
taskView .setTaskThumbnailSplashAlpha (mTaskThumbnailSplashAlpha );
1993
1992
}
1994
1993
}
1995
- // resetTaskVisuals is called at the end of dismiss animation which could update
1996
- // primary and secondary translation of the live tile cut out. We will need to do so
1997
- // here accordingly.
1998
- runActionOnRemoteHandles (remoteTargetHandle -> {
1999
- TaskViewSimulator simulator = remoteTargetHandle .getTaskViewSimulator ();
2000
- simulator .taskPrimaryTranslation .value = 0 ;
2001
- simulator .taskSecondaryTranslation .value = 0 ;
2002
- simulator .fullScreenProgress .value = 0 ;
2003
- simulator .recentsViewScale .value = 1 ;
2004
- });
2005
- // Similar to setRunningTaskHidden below, reapply the state before runningTaskView is
2006
- // null.
2007
- if (!mRunningTaskShowScreenshot ) {
2008
- setRunningTaskViewShowScreenshot (mRunningTaskShowScreenshot );
2009
- }
1994
+
2010
1995
if (mRunningTaskTileHidden ) {
2011
1996
setRunningTaskHidden (mRunningTaskTileHidden );
2012
1997
}
@@ -2096,6 +2081,8 @@ private void updateOrientationHandler(boolean forceRecreateDragLayerControllers)
2096
2081
|| mOrientationState .getRecentsActivityRotation () != ROTATION_0 ;
2097
2082
mActionsView .updateHiddenFlags (HIDDEN_NON_ZERO_ROTATION ,
2098
2083
!mOrientationState .isRecentsActivityRotationAllowed () && isInLandscape );
2084
+
2085
+ mIsLandScape = isInLandscape ;
2099
2086
2100
2087
// Recalculate DeviceProfile dependent layout.
2101
2088
updateSizeAndPadding ();
@@ -2108,6 +2095,10 @@ private void updateOrientationHandler(boolean forceRecreateDragLayerControllers)
2108
2095
setCurrentPage (mCurrentPage );
2109
2096
}
2110
2097
2098
+ public boolean getLandScape () {
2099
+ return mIsLandScape ;
2100
+ }
2101
+
2111
2102
private void onOrientationChanged () {
2112
2103
// If overview is in modal state when rotate, reset it to overview state without running
2113
2104
// animation.
@@ -2485,14 +2476,10 @@ public void reset() {
2485
2476
Log .d (TAG , "reset - mEnableDrawingLiveTile: " + mEnableDrawingLiveTile
2486
2477
+ ", mRecentsAnimationController: " + mRecentsAnimationController );
2487
2478
if (mEnableDrawingLiveTile ) {
2488
- if (mRecentsAnimationController != null ) {
2489
- // We owns mRecentsAnimationController, finish it now to clean up.
2490
- finishRecentsAnimation (true /* toRecents */ , null );
2491
- } else {
2492
- // Only clean up target set if we no longer owns mRecentsAnimationController.
2493
- runActionOnRemoteHandles (remoteTargetHandle ->
2494
- remoteTargetHandle .getTransformParams ().setTargetSet (null ));
2495
- }
2479
+ mRecentsAnimationController = null ;
2480
+ // Only clean up target set if we no longer owns mRecentsAnimationController.
2481
+ runActionOnRemoteHandles (remoteTargetHandle ->
2482
+ remoteTargetHandle .getTransformParams ().setTargetSet (null ));
2496
2483
setEnableDrawingLiveTile (false );
2497
2484
}
2498
2485
runActionOnRemoteHandles (remoteTargetHandle ->
@@ -2756,10 +2743,6 @@ public void onGestureAnimationEnd() {
2756
2743
animateActionsViewIn ();
2757
2744
2758
2745
mCurrentGestureEndTarget = null ;
2759
-
2760
- switchToScreenshot (
2761
- () -> finishRecentsAnimation (true /* toRecents */ , false /* shouldPip */ ,
2762
- null ));
2763
2746
}
2764
2747
2765
2748
/**
@@ -2897,13 +2880,7 @@ public void setRunningTaskHidden(boolean isHidden) {
2897
2880
}
2898
2881
}
2899
2882
2900
- private void setRunningTaskViewShowScreenshot (boolean showScreenshot ) {
2901
- mRunningTaskShowScreenshot = showScreenshot ;
2902
- TaskView runningTaskView = getRunningTaskView ();
2903
- if (runningTaskView != null ) {
2904
- runningTaskView .setShowScreenshot (mRunningTaskShowScreenshot );
2905
- }
2906
- }
2883
+ private void setRunningTaskViewShowScreenshot (boolean showScreenshot ) {}
2907
2884
2908
2885
public void setTaskIconScaledDown (boolean isScaledDown ) {
2909
2886
if (mTaskIconScaledDown != isScaledDown ) {
@@ -3317,19 +3294,6 @@ private void addDismissedTaskAnimations(TaskView taskView, long duration,
3317
3294
3318
3295
anim .add (ObjectAnimator .ofFloat (taskView , secondaryViewTranslate ,
3319
3296
verticalFactor * secondaryTaskDimension * 2 ).setDuration (duration ), LINEAR , sp );
3320
-
3321
- if (taskView .isRunningTask ()) {
3322
- anim .addOnFrameCallback (() -> {
3323
- if (!mEnableDrawingLiveTile ) return ;
3324
- runActionOnRemoteHandles (
3325
- remoteTargetHandle -> remoteTargetHandle .getTaskViewSimulator ()
3326
- .taskSecondaryTranslation .value = getPagedOrientationHandler ()
3327
- .getSecondaryValue (taskView .getTranslationX (),
3328
- taskView .getTranslationY ()
3329
- ));
3330
- redrawLiveTile ();
3331
- });
3332
- }
3333
3297
}
3334
3298
3335
3299
/**
@@ -3390,19 +3354,6 @@ private void createInitialSplitSelectAnimation(PendingAnimation anim) {
3390
3354
3391
3355
InteractionJankMonitorWrapper .begin (this , Cuj .CUJ_SPLIT_SCREEN_ENTER ,
3392
3356
"First tile selected" );
3393
- anim .addListener (new AnimatorListenerAdapter () {
3394
- @ Override
3395
- public void onAnimationStart (Animator animation ) {
3396
- if (mSplitHiddenTaskView == getRunningTaskView ()) {
3397
- finishRecentsAnimation (true /* toRecents */ , false /* shouldPip */ ,
3398
- null /* onFinishComplete */ );
3399
- } else {
3400
- switchToScreenshot (
3401
- () -> finishRecentsAnimation (true /* toRecents */ ,
3402
- false /* shouldPip */ , null /* onFinishComplete */ ));
3403
- }
3404
- }
3405
- });
3406
3357
anim .addEndListener (success -> {
3407
3358
if (success ) {
3408
3359
InteractionJankMonitorWrapper .end (Cuj .CUJ_SPLIT_SCREEN_ENTER );
@@ -3608,16 +3559,6 @@ public void createTaskDismissAnimation(PendingAnimation anim, TaskView dismissed
3608
3559
dismissTranslationInterpolationEnd
3609
3560
- halfAdditionalDismissTranslationOffset ,
3610
3561
END_DISMISS_TRANSLATION_INTERPOLATION_OFFSET , 1 );
3611
- if (mEnableDrawingLiveTile && taskView .isRunningTask ()) {
3612
- anim .addOnFrameCallback (() -> {
3613
- runActionOnRemoteHandles (
3614
- remoteTargetHandle ->
3615
- remoteTargetHandle .getTaskViewSimulator ()
3616
- .taskPrimaryTranslation .value =
3617
- TaskView .GRID_END_TRANSLATION_X .get (taskView ));
3618
- redrawLiveTile ();
3619
- });
3620
- }
3621
3562
}
3622
3563
3623
3564
// Change alpha of clear all if translating grid to hide it
@@ -3738,20 +3679,6 @@ public void onAnimationEnd(Animator animation) {
3738
3679
)
3739
3680
);
3740
3681
3741
- if (mEnableDrawingLiveTile && child instanceof TaskView
3742
- && ((TaskView ) child ).isRunningTask ()) {
3743
- anim .addOnFrameCallback (() -> {
3744
- runActionOnRemoteHandles (
3745
- remoteTargetHandle ->
3746
- remoteTargetHandle .getTaskViewSimulator ()
3747
- .taskPrimaryTranslation .value =
3748
- getPagedOrientationHandler ().getPrimaryValue (
3749
- child .getTranslationX (),
3750
- child .getTranslationY ()
3751
- ));
3752
- redrawLiveTile ();
3753
- });
3754
- }
3755
3682
needsCurveUpdates = true ;
3756
3683
}
3757
3684
} else if (child instanceof TaskView ) {
@@ -3854,12 +3781,7 @@ secondaryTranslation, clampToProgress(LINEAR, animationStartProgress,
3854
3781
mPendingAnimation .addEndListener (new Consumer <Boolean >() {
3855
3782
@ Override
3856
3783
public void accept (Boolean success ) {
3857
- if (mEnableDrawingLiveTile && dismissedTaskView .isRunningTask () && success ) {
3858
- finishRecentsAnimation (true /* toRecents */ , false /* shouldPip */ ,
3859
- () -> onEnd (success ));
3860
- } else {
3861
- onEnd (success );
3862
- }
3784
+ onEnd (success );
3863
3785
}
3864
3786
3865
3787
@ SuppressWarnings ("WrongCall" )
@@ -3871,12 +3793,7 @@ private void onEnd(boolean success) {
3871
3793
if (success ) {
3872
3794
if (shouldRemoveTask ) {
3873
3795
if (dismissedTaskView .getTask () != null ) {
3874
- if (dismissedTaskView .isRunningTask ()) {
3875
- finishRecentsAnimation (true /* toRecents */ , false /* shouldPip */ ,
3876
- () -> removeTaskInternal (dismissedTaskViewId ));
3877
- } else {
3878
- removeTaskInternal (dismissedTaskViewId );
3879
- }
3796
+ removeTaskInternal (dismissedTaskViewId );
3880
3797
announceForAccessibility (
3881
3798
getResources ().getString (R .string .task_view_closed ));
3882
3799
mActivity .getStatsLogManager ().logger ()
@@ -4589,12 +4506,6 @@ private void updatePageOffsets() {
4589
4506
? ((TaskView ) child ).getPrimaryTaskOffsetTranslationProperty ()
4590
4507
: getPagedOrientationHandler ().getPrimaryViewTranslate ();
4591
4508
translationPropertyX .set (child , totalTranslationX );
4592
- if (mEnableDrawingLiveTile && i == getRunningTaskIndex ()) {
4593
- runActionOnRemoteHandles (
4594
- remoteTargetHandle -> remoteTargetHandle .getTaskViewSimulator ()
4595
- .taskPrimaryTranslation .value = totalTranslationX );
4596
- redrawLiveTile ();
4597
- }
4598
4509
4599
4510
if (showAsGrid && enableGridOnlyOverview () && child instanceof TaskView ) {
4600
4511
float totalTranslationY = getVerticalOffsetSize (i , modalOffset );
@@ -4798,6 +4709,8 @@ public void initiateSplitSelect(TaskView taskView, @StagePosition int stagePosit
4798
4709
mSplitSelectStateController .setAnimateCurrentTaskDismissal (
4799
4710
true /*animateCurrentTaskDismissal*/ );
4800
4711
mSplitHiddenTaskViewIndex = indexOfChild (taskView );
4712
+ finishRecentsAnimation (true /* toRecents */ , false /* shouldPip */ ,
4713
+ null /* onFinishComplete */ );
4801
4714
if (isDesktopModeSupported ()) {
4802
4715
updateDesktopTaskVisibility (false /* visible */ );
4803
4716
}
@@ -5189,15 +5102,6 @@ public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) {
5189
5102
anim .play (ObjectAnimator .ofFloat (getPageAt (centerTaskIndex ),
5190
5103
getPagedOrientationHandler ().getPrimaryViewTranslate (), primaryTranslation ));
5191
5104
int runningTaskIndex = getRunningTaskIndex ();
5192
- if (runningTaskIndex != -1 && runningTaskIndex != taskIndex
5193
- && getRemoteTargetHandles () != null ) {
5194
- for (RemoteTargetHandle remoteHandle : getRemoteTargetHandles ()) {
5195
- anim .play (ObjectAnimator .ofFloat (
5196
- remoteHandle .getTaskViewSimulator ().taskPrimaryTranslation ,
5197
- AnimatedFloat .VALUE ,
5198
- primaryTranslation ));
5199
- }
5200
- }
5201
5105
5202
5106
int otherAdjacentTaskIndex = centerTaskIndex + (centerTaskIndex - taskIndex );
5203
5107
if (otherAdjacentTaskIndex >= 0 && otherAdjacentTaskIndex < getPageCount ()) {
@@ -5290,10 +5194,6 @@ public PendingAnimation createTaskLaunchAnimation(
5290
5194
5291
5195
mPendingAnimation = new PendingAnimation (duration );
5292
5196
mPendingAnimation .add (anim );
5293
- runActionOnRemoteHandles (
5294
- remoteTargetHandle -> remoteTargetHandle .getTaskViewSimulator ()
5295
- .addOverviewToAppAnim (mPendingAnimation , interpolator ));
5296
- mPendingAnimation .addOnFrameCallback (this ::redrawLiveTile );
5297
5197
mPendingAnimation .addEndListener (isSuccess -> {
5298
5198
if (isSuccess ) {
5299
5199
if (tv .getTaskIds ()[1 ] != -1 && mRemoteTargetHandles != null ) {
@@ -5305,12 +5205,7 @@ public PendingAnimation createTaskLaunchAnimation(
5305
5205
dividerAnimator .end ();
5306
5206
});
5307
5207
}
5308
- if (tv .isRunningTask ()) {
5309
- finishRecentsAnimation (false /* toRecents */ , null );
5310
- onTaskLaunchAnimationEnd (true /* success */ );
5311
- } else {
5312
- tv .launchTask (this ::onTaskLaunchAnimationEnd );
5313
- }
5208
+ tv .launchTask (this ::onTaskLaunchAnimationEnd );
5314
5209
Task task = tv .getTask ();
5315
5210
if (task != null ) {
5316
5211
mActivity .getStatsLogManager ().logger ().withItemInfo (tv .getItemInfo ())
@@ -6190,6 +6085,9 @@ private void doScrollScale() {
6190
6085
boolean layoutInLandscape = mOrientationState .getRecentsActivityRotation () != ROTATION_0
6191
6086
&& mOrientationState .getRecentsActivityRotation () != ROTATION_180 ;
6192
6087
boolean canRotateRecents = mOrientationState .isRecentsActivityRotationAllowed ();
6088
+
6089
+ mIsLandScape = touchInLandscape ;
6090
+
6193
6091
int childCount = Math .min (mPageScrolls .length , getChildCount ());
6194
6092
int curScroll = !canRotateRecents && touchInLandscape && !layoutInLandscape
6195
6093
? getScrollY () : getScrollX ();
0 commit comments