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 ViewcreateSplashView(Context context, Bundle savedInstanceState)Deprecated.Creates aViewto be displayed as a splash screen before Flutter renders its first frame.default booleandoesSplashViewRememberItsTransition()Deprecated.Returnstrueif the splashViewbuilt by thisSplashScreenremembers its transition progress across configuration changes by saving that progress toViewstate.default BundlesaveSplashScreenState()Deprecated.Returns whatever state is necessary to restore a splashViewafter destruction and recreation, e.g., orientation change.voidtransitionToFlutter(Runnable onTransitionComplete)Deprecated.Invoked by Flutter when Flutter has rendered its first frame, and would like thesplashViewto disappear.
-
-
-
Method Detail
-
createSplashView
@Nullable View createSplashView(@NonNull Context context, @Nullable Bundle savedInstanceState)
Deprecated.Creates aViewto 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 thesplashViewto disappear.The provided
onTransitionCompletecallback must be invoked when the splashViewhas finished transitioning itself away. The splashViewwill be removed and destroyed when the callback is invoked.- Parameters:
onTransitionComplete- The callback after the transition has completed.
-
doesSplashViewRememberItsTransition
default boolean doesSplashViewRememberItsTransition()
Deprecated.Returnstrueif the splashViewbuilt by thisSplashScreenremembers its transition progress across configuration changes by saving that progress toViewstate. Returnsfalseotherwise.The typical return value for this method is
false. When the return value isfalse, the following can happen:- Splash
Viewbegins transitioning to the Flutter UI. - A configuration change occurs, like an orientation change, and the
Activityis re-created, along with theViewhierarchy. - The remainder of the splash transition is skipped and the Flutter UI is displayed.
Returning
truefrom this method will cause the given splashViewto be displayed in theViewhierarchy, even if Flutter has already rendered its first frame. It is then the responsibility of the splashViewto remember its previous transition progress, restart any animations, and then trigger its completion callback when appropriate. It is also the responsibility of the splashViewto immediately invoke the completion callback if it has already completed its transition. By meeting these requirements, and returningtruefrom this method, the splash screen experience will be completely seamless, including configuration changes.- Returns:
- True if the given splash
Viewshould be displayed in theViewhierarchy.
- Splash
-
saveSplashScreenState
@Nullable default Bundle saveSplashScreenState()
Deprecated.Returns whatever state is necessary to restore a splashViewafter destruction and recreation, e.g., orientation change.- Returns:
- Bundle used to restore a splash screen state.
-
-