Enum TransparencyMode
- java.lang.Object
-
- java.lang.Enum<TransparencyMode>
-
- io.flutter.embedding.android.TransparencyMode
-
- All Implemented Interfaces:
Serializable,Comparable<TransparencyMode>
public enum TransparencyMode extends Enum<TransparencyMode>
Transparency mode for a Flutter UI.TransparencyModeimpacts the visual behavior and performance of aFlutterSurfaceView, which is displayed when a Flutter UI usesRenderMode.surface.TransparencyModedoes not impactFlutterTextureView, which is displayed when a Flutter UI usesRenderMode.texture, because aFlutterTextureViewautomatically comes with transparency.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description opaqueRenders a Flutter UI without any transparency.transparentRenders a Flutter UI with transparency.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TransparencyModevalueOf(String name)Returns the enum constant of this type with the specified name.static TransparencyMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
opaque
public static final TransparencyMode opaque
Renders a Flutter UI without any transparency. This affects Flutter UI's withRenderMode.surfaceby introducing a base color of black, and places theFlutterSurfaceView'sWindowbehind all other content.In
RenderMode.surface, this mode is the most performant and is a good choice for fullscreen Flutter UIs that will not undergoFragmenttransactions. If this mode is used within aFragment, and thatFragmentis replaced by another one, a brief black flicker may be visible during the switch.
-
transparent
public static final TransparencyMode transparent
Renders a Flutter UI with transparency. This affects Flutter UI's inRenderMode.surfaceby allowing background transparency, and places theFlutterSurfaceView'sWindowon top of all other content.In
RenderMode.surface, this mode is less performant thanopaque, but this mode avoids the black flicker problem thatopaquehas when going throughFragmenttransactions. Consider using thisTransparencyModeif you intend to switchFragments at runtime that contain a Flutter UI.
-
-
Method Detail
-
values
public static TransparencyMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TransparencyMode c : TransparencyMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TransparencyMode valueOf(String name)
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
-
-