Class FlutterFragmentActivity.CachedEngineIntentBuilder
- java.lang.Object
-
- io.flutter.embedding.android.FlutterFragmentActivity.CachedEngineIntentBuilder
-
- Enclosing class:
- FlutterFragmentActivity
public static class FlutterFragmentActivity.CachedEngineIntentBuilder extends Object
Builder to create anIntentthat launches aFlutterFragmentActivitywith an existingFlutterEnginethat is cached inFlutterEngineCache.
-
-
Constructor Summary
Constructors Constructor Description CachedEngineIntentBuilder(Class<? extends FlutterFragmentActivity> activityClass, String engineId)Constructor that allows thisCachedEngineIntentBuilderto be used by subclasses ofFlutterFragmentActivity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlutterFragmentActivity.CachedEngineIntentBuilderbackgroundMode(FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)The mode ofFlutterFragmentActivity's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaqueorFlutterActivityLaunchConfigs.BackgroundMode.transparent.Intentbuild(Context context)Creates and returns anIntentthat will launch aFlutterFragmentActivitywith the desired configuration.FlutterFragmentActivity.CachedEngineIntentBuilderdestroyEngineWithActivity(boolean destroyEngineWithActivity)Returns true if the cachedFlutterEngineshould be destroyed and removed from the cache when thisFlutterFragmentActivityis destroyed.
-
-
-
Constructor Detail
-
CachedEngineIntentBuilder
public CachedEngineIntentBuilder(@NonNull Class<? extends FlutterFragmentActivity> activityClass, @NonNull String engineId)Constructor that allows thisCachedEngineIntentBuilderto be used by subclasses ofFlutterFragmentActivity.Subclasses of
FlutterFragmentActivityshould provide their own static version ofFlutterFragmentActivity.withCachedEngine(String), which returns an instance ofCachedEngineIntentBuilderconstructed with aClassreference to theFlutterFragmentActivitysubclass, e.g.:return new CachedEngineIntentBuilder(MyFlutterActivity.class, engineId);
-
-
Method Detail
-
destroyEngineWithActivity
public FlutterFragmentActivity.CachedEngineIntentBuilder destroyEngineWithActivity(boolean destroyEngineWithActivity)
Returns true if the cachedFlutterEngineshould be destroyed and removed from the cache when thisFlutterFragmentActivityis destroyed.The default value is
false.
-
backgroundMode
@NonNull public FlutterFragmentActivity.CachedEngineIntentBuilder backgroundMode(@NonNull FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)
The mode ofFlutterFragmentActivity's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaqueorFlutterActivityLaunchConfigs.BackgroundMode.transparent.The default background mode is
FlutterActivityLaunchConfigs.BackgroundMode.opaque.Choosing a background mode of
FlutterActivityLaunchConfigs.BackgroundMode.transparentwill configure the innerFlutterViewof thisFlutterFragmentActivityto be configured with aFlutterTextureViewto support transparency. This choice has a non-trivial performance impact. A transparent background should only be used if it is necessary for the app design being implemented.A
FlutterFragmentActivitythat is configured with a background mode ofFlutterActivityLaunchConfigs.BackgroundMode.transparentmust have a theme applied to it that includes the following property:<item name="android:windowIsTranslucent">true</item>.
-
-