Enum TextureRegistry.SurfaceLifecycle
- All Implemented Interfaces:
Serializable
,Comparable<TextureRegistry.SurfaceLifecycle>
,java.lang.constant.Constable
- Enclosing interface:
- TextureRegistry
TextureRegistry.SurfaceProducer
created by TextureRegistry.createSurfaceProducer()
manages the lifecycle
of the created surface.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe surface and latest image should be kept, even if the app enters the background.The surface will be reset if the app enters the background. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this type with the specified name.static TextureRegistry.SurfaceLifecycle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
manual
The surface and latest image should be kept, even if the app enters the background.The application, or calling code, can choose to (manually) reset the surface at the appropriate time (such as to lower memory pressure, or cleanup an unused surface), but by default the surface will never be reset, and as a result, new images do not have to be drawn to the surface.
This is an appropriate lifecycle for external textures, as it is not guaranteed that new images will be drawn to the surface, and whether the image should be kept when the app is backgrounded.
-
resetInBackground
The surface will be reset if the app enters the background.While the application can choose to manually reset the surface, Flutter may automatically reset the surface when the app enters the background. If the surface is reset, and no new images are drawn to the surface, the texture will appear blank.
This is an appropriate lifecycle for platform views, as the platform implementation will request a new surface, and draw to, as appropriate when resuming from the background, and producing a new image when coming back to the foreground.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-