Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
TransparencyMode.java
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package io.flutter.embedding.android;
6
7/**
8 * Transparency mode for a Flutter UI.
9 *
10 * <p>{@code TransparencyMode} impacts the visual behavior and performance of a {@link
11 * FlutterSurfaceView}, which is displayed when a Flutter UI uses {@link RenderMode#surface}.
12 *
13 * <p>{@code TransparencyMode} does not impact {@link FlutterTextureView}, which is displayed when a
14 * Flutter UI uses {@link RenderMode#texture}, because a {@link FlutterTextureView} automatically
15 * comes with transparency.
16 */
17public enum TransparencyMode {
18 /**
19 * Renders a Flutter UI without any transparency. This affects Flutter UI's with {@link
20 * RenderMode#surface} by introducing a base color of black, and places the {@link
21 * FlutterSurfaceView}'s {@code Window} behind all other content.
22 *
23 * <p>In {@link RenderMode#surface}, this mode is the most performant and is a good choice for
24 * fullscreen Flutter UIs that will not undergo {@code Fragment} transactions. If this mode is
25 * used within a {@code Fragment}, and that {@code Fragment} is replaced by another one, a brief
26 * black flicker may be visible during the switch.
27 */
29 /**
30 * Renders a Flutter UI with transparency. This affects Flutter UI's in {@link RenderMode#surface}
31 * by allowing background transparency, and places the {@link FlutterSurfaceView}'s {@code Window}
32 * on top of all other content.
33 *
34 * <p>In {@link RenderMode#surface}, this mode is less performant than {@link #opaque}, but this
35 * mode avoids the black flicker problem that {@link #opaque} has when going through {@code
36 * Fragment} transactions. Consider using this {@code TransparencyMode} if you intend to switch
37 * {@code Fragment}s at runtime that contain a Flutter UI.
38 */
39 transparent