public enum TransparencyMode extends Enum<TransparencyMode>
TransparencyMode
impacts the visual behavior and performance of a FlutterSurfaceView
, which is displayed when a Flutter UI uses RenderMode.surface
.
TransparencyMode
does not impact FlutterTextureView
, which is displayed when a
Flutter UI uses RenderMode.texture
, because a FlutterTextureView
automatically
comes with transparency.
Enum Constant and Description |
---|
opaque
Renders a Flutter UI without any transparency.
|
transparent
Renders a Flutter UI with transparency.
|
Modifier and Type | Method and Description |
---|---|
static TransparencyMode |
valueOf(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.
|
public static final TransparencyMode opaque
RenderMode.surface
by introducing a base color of black, and places the FlutterSurfaceView
's Window
behind all other content.
In RenderMode.surface
, this mode is the most performant and is a good choice for
fullscreen Flutter UIs that will not undergo Fragment
transactions. If this mode is
used within a Fragment
, and that Fragment
is replaced by another one, a brief
black flicker may be visible during the switch.
public static final TransparencyMode transparent
RenderMode.surface
by allowing background transparency, and places the FlutterSurfaceView
's Window
on top of all other content.
In RenderMode.surface
, this mode is less performant than opaque
, but this
mode avoids the black flicker problem that opaque
has when going through Fragment
transactions. Consider using this TransparencyMode
if you intend to switch
Fragment
s at runtime that contain a Flutter UI.
public static TransparencyMode[] values()
for (TransparencyMode c : TransparencyMode.values()) System.out.println(c);
public static TransparencyMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null