Merge "Ignore exit animation when view is detached from window." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a1b3ce5250
@@ -235,7 +235,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onAnimationProgress(float linearProgress) {
|
void onAnimationProgress(float linearProgress) {
|
||||||
if (mFirstWindowSurface == null || !mFirstWindowSurface.isValid()) {
|
if (mFirstWindowSurface == null || !mFirstWindowSurface.isValid()
|
||||||
|
|| !mSplashScreenView.isAttachedToWindow()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +268,7 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final SurfaceControl.Transaction tx = mTransactionPool.acquire();
|
final SurfaceControl.Transaction tx = mTransactionPool.acquire();
|
||||||
|
if (mSplashScreenView.isAttachedToWindow()) {
|
||||||
tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
|
tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
|
||||||
|
|
||||||
SyncRtSurfaceTransactionApplier.SurfaceParams
|
SyncRtSurfaceTransactionApplier.SurfaceParams
|
||||||
@@ -276,6 +278,10 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
|
|||||||
.withMergeTransaction(tx)
|
.withMergeTransaction(tx)
|
||||||
.build();
|
.build();
|
||||||
mApplier.scheduleApply(params);
|
mApplier.scheduleApply(params);
|
||||||
|
} else {
|
||||||
|
tx.setWindowCrop(mFirstWindowSurface, null);
|
||||||
|
tx.apply();
|
||||||
|
}
|
||||||
mTransactionPool.release(tx);
|
mTransactionPool.release(tx);
|
||||||
|
|
||||||
Choreographer.getSfInstance().postCallback(CALLBACK_COMMIT,
|
Choreographer.getSfInstance().postCallback(CALLBACK_COMMIT,
|
||||||
@@ -287,13 +293,14 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
|
|||||||
if (DEBUG_EXIT_ANIMATION) {
|
if (DEBUG_EXIT_ANIMATION) {
|
||||||
Slog.v(TAG, "vanish animation finished");
|
Slog.v(TAG, "vanish animation finished");
|
||||||
}
|
}
|
||||||
mSplashScreenView.post(() -> {
|
|
||||||
|
if (mSplashScreenView.isAttachedToWindow()) {
|
||||||
mSplashScreenView.setVisibility(GONE);
|
mSplashScreenView.setVisibility(GONE);
|
||||||
if (mFinishCallback != null) {
|
if (mFinishCallback != null) {
|
||||||
mFinishCallback.run();
|
mFinishCallback.run();
|
||||||
mFinishCallback = null;
|
mFinishCallback = null;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
if (mShiftUpAnimation != null) {
|
if (mShiftUpAnimation != null) {
|
||||||
mShiftUpAnimation.finish();
|
mShiftUpAnimation.finish();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user