Interface SplashScreen
-
- All Known Implementing Classes:
DrawableSplashScreen
@Deprecated public interface SplashScreen
Deprecated.Splash screen configuration for a given Flutter experience.Implementations provide a visual representation of a splash screen in
createSplashView(Context, Bundle)
, and implement a transition from the splash UI to Flutter's UI intransitionToFlutter(Runnable)
.Please use the new Splash screen API available on Android S. On lower versions of Android, it's no longer necessary to display a splash screen to wait for the Flutter first frame.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description View
createSplashView(Context context, Bundle savedInstanceState)
Deprecated.Creates aView
to be displayed as a splash screen before Flutter renders its first frame.default boolean
doesSplashViewRememberItsTransition()
Deprecated.Returnstrue
if the splashView
built by thisSplashScreen
remembers its transition progress across configuration changes by saving that progress toView
state.default Bundle
saveSplashScreenState()
Deprecated.Returns whatever state is necessary to restore a splashView
after destruction and recreation, e.g., orientation change.void
transitionToFlutter(Runnable onTransitionComplete)
Deprecated.Invoked by Flutter when Flutter has rendered its first frame, and would like thesplashView
to disappear.
-
-
-
Method Detail
-
createSplashView
@Nullable View createSplashView(@NonNull Context context, @Nullable Bundle savedInstanceState)
Deprecated.Creates aView
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.
- Parameters:
context
- The current context. e.g. The activity.savedInstanceState
- If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied inonSaveInstanceState(Bundle)
.- Returns:
- The splash screen view.
-
transitionToFlutter
void transitionToFlutter(@NonNull Runnable onTransitionComplete)
Deprecated.Invoked by Flutter when Flutter has rendered its first frame, and would like thesplashView
to disappear.The provided
onTransitionComplete
callback must be invoked when the splashView
has finished transitioning itself away. The splashView
will be removed and destroyed when the callback is invoked.- Parameters:
onTransitionComplete
- The callback after the transition has completed.
-
doesSplashViewRememberItsTransition
default boolean doesSplashViewRememberItsTransition()
Deprecated.Returnstrue
if the splashView
built by thisSplashScreen
remembers its transition progress across configuration changes by saving that progress toView
state. Returnsfalse
otherwise.The typical return value for this method is
false
. When the return value isfalse
, the following can happen:- Splash
View
begins transitioning to the Flutter UI. - A configuration change occurs, like an orientation change, and the
Activity
is re-created, along with theView
hierarchy. - The remainder of the splash transition is skipped and the Flutter UI is displayed.
Returning
true
from this method will cause the given splashView
to be displayed in theView
hierarchy, even if Flutter has already rendered its first frame. It is then the responsibility of the splashView
to remember its previous transition progress, restart any animations, and then trigger its completion callback when appropriate. It is also the responsibility of the splashView
to immediately invoke the completion callback if it has already completed its transition. By meeting these requirements, and returningtrue
from this method, the splash screen experience will be completely seamless, including configuration changes.- Returns:
- True if the given splash
View
should be displayed in theView
hierarchy.
- Splash
-
saveSplashScreenState
@Nullable default Bundle saveSplashScreenState()
Deprecated.Returns whatever state is necessary to restore a splashView
after destruction and recreation, e.g., orientation change.- Returns:
- Bundle used to restore a splash screen state.
-
-