public final class DrawableSplashScreen extends Object implements SplashScreen
SplashScreen
that displays a given Drawable
, which then fades its alpha
to zero when instructed to transitionToFlutter(Runnable)
.Modifier and Type | Class and Description |
---|---|
static class |
DrawableSplashScreen.DrawableSplashScreenView |
Constructor and Description |
---|
DrawableSplashScreen(Drawable drawable)
Constructs a
DrawableSplashScreen that displays the given drawable and
crossfades to Flutter content in 500 milliseconds. |
DrawableSplashScreen(Drawable drawable,
ImageView.ScaleType scaleType,
long crossfadeDurationInMillis)
Constructs a
DrawableSplashScreen that displays the given drawable and
crossfades to Flutter content in the given crossfadeDurationInMillis . |
Modifier and Type | Method and Description |
---|---|
View |
createSplashView(Context context,
Bundle savedInstanceState)
Creates a
View to be displayed as a splash screen before
Flutter renders its first frame. |
void |
transitionToFlutter(Runnable onTransitionComplete)
Invoked by Flutter when Flutter has rendered its first frame, and would like
the
splashView to disappear. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doesSplashViewRememberItsTransition, saveSplashScreenState
public DrawableSplashScreen(@NonNull Drawable drawable)
DrawableSplashScreen
that displays the given drawable
and
crossfades to Flutter content in 500 milliseconds.public DrawableSplashScreen(@NonNull Drawable drawable, @NonNull ImageView.ScaleType scaleType, long crossfadeDurationInMillis)
DrawableSplashScreen
that displays the given drawable
and
crossfades to Flutter content in the given crossfadeDurationInMillis
.
drawable
- The Drawable
to be displayed as a splash screen.scaleType
- The ImageView.ScaleType
to be applied to the Drawable
when the
Drawable
is displayed full-screen.@Nullable public View createSplashView(@NonNull Context context, @Nullable Bundle savedInstanceState)
SplashScreen
View
to be displayed as a splash screen before
Flutter renders its first frame.
This method can be called at any time, and may be called multiple times depending on Android configuration changes that require recreation of a view hierarchy. Implementers that provide a stateful splash view, such as one with animations, should take care to migrate that animation state from the previously returned splash view to the newly created splash view.
createSplashView
in interface SplashScreen
public void transitionToFlutter(@NonNull Runnable onTransitionComplete)
SplashScreen
splashView
to disappear.
The provided onTransitionComplete
callback must be invoked when
the splash View
has finished transitioning itself away. The splash
View
will be removed and destroyed when the callback is invoked.
transitionToFlutter
in interface SplashScreen