Merge "Always do the app reveal animation when dismissing the splash screen" into sc-dev
This commit is contained in:
@@ -85,7 +85,6 @@ public final class SplashScreenView extends FrameLayout {
|
|||||||
| FLAG_TRANSLUCENT_NAVIGATION | FLAG_TRANSLUCENT_STATUS;
|
| FLAG_TRANSLUCENT_NAVIGATION | FLAG_TRANSLUCENT_STATUS;
|
||||||
|
|
||||||
private boolean mNotCopyable;
|
private boolean mNotCopyable;
|
||||||
private boolean mRevealAnimationSupported = true;
|
|
||||||
private int mInitBackgroundColor;
|
private int mInitBackgroundColor;
|
||||||
private int mInitIconBackgroundColor;
|
private int mInitIconBackgroundColor;
|
||||||
private View mIconView;
|
private View mIconView;
|
||||||
@@ -352,25 +351,6 @@ public final class SplashScreenView extends FrameLayout {
|
|||||||
return !mNotCopyable;
|
return !mNotCopyable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to true, indicates to the system that this view can be dismissed by playing the
|
|
||||||
* Reveal animation.
|
|
||||||
* <p>
|
|
||||||
* If the exit animation is handled by the client, the animation won't be played anyway.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void setRevealAnimationSupported(boolean support) {
|
|
||||||
mRevealAnimationSupported = support;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether this view support reveal animation.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public boolean isRevealAnimationSupported() {
|
|
||||||
return mRevealAnimationSupported;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when this {@link SplashScreenView} has been copied to be transferred to the client.
|
* Called when this {@link SplashScreenView} has been copied to be transferred to the client.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
View iconView = view.getIconView();
|
View iconView = view.getIconView();
|
||||||
if (iconView == null) {
|
if (iconView == null || iconView.getBackground() == null) {
|
||||||
mIconFadeOutDuration = 0;
|
mIconFadeOutDuration = 0;
|
||||||
mIconStartAlpha = 0;
|
mIconStartAlpha = 0;
|
||||||
mAppRevealDelay = 0;
|
mAppRevealDelay = 0;
|
||||||
|
|||||||
@@ -407,7 +407,6 @@ public class SplashscreenContentDrawer {
|
|||||||
}
|
}
|
||||||
if (mEmptyView) {
|
if (mEmptyView) {
|
||||||
splashScreenView.setNotCopyable();
|
splashScreenView.setNotCopyable();
|
||||||
splashScreenView.setRevealAnimationSupported(false);
|
|
||||||
}
|
}
|
||||||
splashScreenView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
splashScreenView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import android.graphics.Rect;
|
|||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.hardware.display.DisplayManager;
|
import android.hardware.display.DisplayManager;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.SystemProperties;
|
|
||||||
import android.os.Trace;
|
import android.os.Trace;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -108,8 +107,6 @@ public class StartingSurfaceDrawer {
|
|||||||
final SplashscreenContentDrawer mSplashscreenContentDrawer;
|
final SplashscreenContentDrawer mSplashscreenContentDrawer;
|
||||||
private Choreographer mChoreographer;
|
private Choreographer mChoreographer;
|
||||||
|
|
||||||
private static final boolean DEBUG_ENABLE_REVEAL_ANIMATION =
|
|
||||||
SystemProperties.getBoolean("persist.debug.enable_reveal_animation", true);
|
|
||||||
/**
|
/**
|
||||||
* @param splashScreenExecutor The thread used to control add and remove starting window.
|
* @param splashScreenExecutor The thread used to control add and remove starting window.
|
||||||
*/
|
*/
|
||||||
@@ -452,24 +449,19 @@ public class StartingSurfaceDrawer {
|
|||||||
if (DEBUG_SPLASH_SCREEN) {
|
if (DEBUG_SPLASH_SCREEN) {
|
||||||
Slog.v(TAG, "Removing splash screen window for task: " + taskId);
|
Slog.v(TAG, "Removing splash screen window for task: " + taskId);
|
||||||
}
|
}
|
||||||
if (record.mContentView != null
|
if (record.mContentView != null) {
|
||||||
&& record.mContentView.isRevealAnimationSupported()) {
|
|
||||||
if (playRevealAnimation) {
|
if (playRevealAnimation) {
|
||||||
if (DEBUG_ENABLE_REVEAL_ANIMATION) {
|
mSplashscreenContentDrawer.applyExitAnimation(record.mContentView,
|
||||||
mSplashscreenContentDrawer.applyExitAnimation(record.mContentView,
|
leash, frame,
|
||||||
leash, frame,
|
() -> removeWindowInner(record.mDecorView, true));
|
||||||
() -> removeWindowInner(record.mDecorView, true));
|
|
||||||
} else {
|
|
||||||
// using the default exit animation from framework
|
|
||||||
removeWindowInner(record.mDecorView, false);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// the SplashScreenView has been copied to client, hide the view to skip
|
// the SplashScreenView has been copied to client, hide the view to skip
|
||||||
// default exit animation
|
// default exit animation
|
||||||
removeWindowInner(record.mDecorView, true);
|
removeWindowInner(record.mDecorView, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// this is a blank splash screen, don't apply reveal animation
|
// shouldn't happen
|
||||||
|
Slog.e(TAG, "Found empty splash screen, remove!");
|
||||||
removeWindowInner(record.mDecorView, false);
|
removeWindowInner(record.mDecorView, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user