Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Protected Member Functions | Static Package Attributes | List of all members
dev.flutter.scenarios.ExternalTextureFlutterActivity Class Reference
Inheritance diagram for dev.flutter.scenarios.ExternalTextureFlutterActivity:
dev.flutter.scenarios.TestActivity dev.flutter.scenarios.TestableFlutterActivity io.flutter.embedding.android.FlutterActivity io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.Host io.flutter.embedding.android.FlutterEngineProvider io.flutter.embedding.android.FlutterEngineConfigurator io.flutter.plugin.platform.PlatformPlugin.PlatformPluginDelegate

Public Member Functions

void waitUntilFlutterRendered ()
 
void onPause ()
 
void onFlutterUiDisplayed ()
 
- Public Member Functions inherited from dev.flutter.scenarios.TestActivity
FlutterShellArgs getFlutterShellArgs ()
 
void onFlutterUiDisplayed ()
 
- Public Member Functions inherited from dev.flutter.scenarios.TestableFlutterActivity
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void waitUntilFlutterRendered ()
 
- Public Member Functions inherited from io.flutter.embedding.android.FlutterActivity
 FlutterActivity ()
 
ExclusiveAppComponent< Activity > getExclusiveAppComponent ()
 
void registerOnBackInvokedCallback ()
 
void unregisterOnBackInvokedCallback ()
 
void setFrameworkHandlesBack (boolean frameworkHandlesBack)
 
void onPostResume ()
 
void release ()
 
void detachFromFlutterEngine ()
 
void onBackPressed ()
 
void startBackGesture (@NonNull BackEvent backEvent)
 
void updateBackGestureProgress (@NonNull BackEvent backEvent)
 
void commitBackGesture ()
 
void cancelBackGesture ()
 
void onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
void onUserLeaveHint ()
 
void onWindowFocusChanged (boolean hasFocus)
 
void onTrimMemory (int level)
 
Context getContext ()
 
Activity getActivity ()
 
Lifecycle getLifecycle ()
 
FlutterShellArgs getFlutterShellArgs ()
 
String getCachedEngineId ()
 
String getCachedEngineGroupId ()
 
boolean shouldDestroyEngineWithHost ()
 
String getDartEntrypointFunctionName ()
 
List< String > getDartEntrypointArgs ()
 
String getDartEntrypointLibraryUri ()
 
String getInitialRoute ()
 
String getAppBundlePath ()
 
RenderMode getRenderMode ()
 
TransparencyMode getTransparencyMode ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
PlatformPlugin providePlatformPlugin ( @Nullable Activity activity, @NonNull FlutterEngine flutterEngine)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean shouldAttachEngineToActivity ()
 
boolean shouldHandleDeeplinking ()
 
void onFlutterSurfaceViewCreated (@NonNull FlutterSurfaceView flutterSurfaceView)
 
void onFlutterTextureViewCreated (@NonNull FlutterTextureView flutterTextureView)
 
void onFlutterUiDisplayed ()
 
void onFlutterUiNoLongerDisplayed ()
 
boolean shouldRestoreAndSaveState ()
 
boolean shouldDispatchAppLifecycleState ()
 
boolean attachToEngineAutomatically ()
 
boolean popSystemNavigator ()
 
void updateSystemUiOverlays ()
 
Context getContext ()
 
boolean shouldHandleDeeplinking ()
 
Activity getActivity ()
 
Lifecycle getLifecycle ()
 
FlutterShellArgs getFlutterShellArgs ()
 
String getCachedEngineId ()
 
String getCachedEngineGroupId ()
 
boolean shouldDestroyEngineWithHost ()
 
void detachFromFlutterEngine ()
 
String getDartEntrypointFunctionName ()
 
String getDartEntrypointLibraryUri ()
 
List< String > getDartEntrypointArgs ()
 
String getAppBundlePath ()
 
String getInitialRoute ()
 
RenderMode getRenderMode ()
 
TransparencyMode getTransparencyMode ()
 
ExclusiveAppComponent< Activity > getExclusiveAppComponent ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
PlatformPlugin providePlatformPlugin ( @Nullable Activity activity, @NonNull FlutterEngine flutterEngine)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean shouldAttachEngineToActivity ()
 
void onFlutterSurfaceViewCreated (@NonNull FlutterSurfaceView flutterSurfaceView)
 
void onFlutterTextureViewCreated (@NonNull FlutterTextureView flutterTextureView)
 
void onFlutterUiDisplayed ()
 
void onFlutterUiNoLongerDisplayed ()
 
boolean shouldRestoreAndSaveState ()
 
void updateSystemUiOverlays ()
 
boolean shouldDispatchAppLifecycleState ()
 
boolean attachToEngineAutomatically ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
boolean popSystemNavigator ()
 
default void setFrameworkHandlesBack (boolean frameworkHandlesBack)
 

Protected Member Functions

void onCreate (@Nullable Bundle savedInstanceState)
 
void getScenarioParams (@NonNull Map< String, Object > args)
 
- Protected Member Functions inherited from dev.flutter.scenarios.TestActivity
void onCreate (@Nullable Bundle savedInstanceState)
 
void onDestroy ()
 
void getScenarioParams (@NonNull Map< String, Object > args)
 
void testFlutterLoaderCallbackWhenInitializedTwice ()
 
- Protected Member Functions inherited from dev.flutter.scenarios.TestableFlutterActivity
void onCreate (@Nullable Bundle savedInstanceState)
 
void notifyFlutterRendered ()
 
- Protected Member Functions inherited from io.flutter.embedding.android.FlutterActivity
void onCreate (@Nullable Bundle savedInstanceState)
 
OnBackInvokedCallback getOnBackInvokedCallback ()
 
void onStart ()
 
void onResume ()
 
void onPause ()
 
void onStop ()
 
void onSaveInstanceState (Bundle outState)
 
void onDestroy ()
 
void onActivityResult (int requestCode, int resultCode, Intent data)
 
void onNewIntent (@NonNull Intent intent)
 
BackgroundMode getBackgroundMode ()
 
FlutterEngine getFlutterEngine ()
 
Bundle getMetaData () throws PackageManager.NameNotFoundException
 

Static Package Attributes

static final String TAG = "Scenarios"
 

Additional Inherited Members

- Static Public Member Functions inherited from io.flutter.embedding.android.FlutterActivity
static Intent createDefaultIntent (@NonNull Context launchContext)
 
static NewEngineIntentBuilder withNewEngine ()
 
static CachedEngineIntentBuilder withCachedEngine (@NonNull String cachedEngineId)
 
static NewEngineInGroupIntentBuilder withNewEngineInGroup (@NonNull String engineGroupId)
 
- Static Public Attributes inherited from io.flutter.embedding.android.FlutterActivity
static final int FLUTTER_VIEW_ID = View.generateViewId()
 
- Protected Attributes inherited from io.flutter.embedding.android.FlutterActivity
FlutterActivityAndFragmentDelegate delegate
 
- Package Functions inherited from io.flutter.embedding.android.FlutterActivity
void setDelegate (@NonNull FlutterActivityAndFragmentDelegate delegate)
 

Detailed Description

Definition at line 45 of file ExternalTextureFlutterActivity.java.

Member Function Documentation

◆ getScenarioParams()

void dev.flutter.scenarios.ExternalTextureFlutterActivity.getScenarioParams ( @NonNull Map< String, Object >  args)
inlineprotected

Populates test-specific parameters that are sent to the Dart test scenario.

Parameters
argsThe map of test arguments

Reimplemented from dev.flutter.scenarios.TestActivity.

Definition at line 154 of file ExternalTextureFlutterActivity.java.

154 {
155 super.getScenarioParams(args);
156 args.put("texture_id", textureId);
157 args.put("texture_width", SURFACE_WIDTH);
158 args.put("texture_height", SURFACE_HEIGHT);
159 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ onCreate()

void dev.flutter.scenarios.ExternalTextureFlutterActivity.onCreate ( @Nullable Bundle  savedInstanceState)
inlineprotected

Reimplemented from dev.flutter.scenarios.TestActivity.

Definition at line 59 of file ExternalTextureFlutterActivity.java.

59 {
60 super.onCreate(savedInstanceState);
61
62 String surfaceRenderer = getIntent().getStringExtra("surface_renderer");
63 assert surfaceRenderer != null;
64 flutterRenderer = selectSurfaceRenderer(surfaceRenderer);
65
66 // Create and place a SurfaceView above the Flutter content.
67 SurfaceView surfaceView = new SurfaceView(getContext());
68 surfaceView.setZOrderMediaOverlay(true);
69 surfaceView.setMinimumWidth(SURFACE_WIDTH);
70 surfaceView.setMinimumHeight(SURFACE_HEIGHT);
71
72 FrameLayout frameLayout = new FrameLayout(getContext());
73 frameLayout.addView(
74 surfaceView,
75 new LayoutParams(
76 ViewGroup.LayoutParams.WRAP_CONTENT,
77 ViewGroup.LayoutParams.WRAP_CONTENT,
78 Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL));
79
80 addContentView(
81 frameLayout,
82 new ViewGroup.LayoutParams(
83 ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
84
85 SurfaceHolder surfaceHolder = surfaceView.getHolder();
86 surfaceHolder.setFixedSize(SURFACE_WIDTH, SURFACE_HEIGHT);
87 }

◆ onFlutterUiDisplayed()

void dev.flutter.scenarios.ExternalTextureFlutterActivity.onFlutterUiDisplayed ( )
inline

Invoked by this delegate when its FlutterView starts painting pixels.

Reimplemented from dev.flutter.scenarios.TestActivity.

Definition at line 142 of file ExternalTextureFlutterActivity.java.

142 {
143 surfaceProducer =
144 Objects.requireNonNull(getFlutterEngine()).getRenderer().createSurfaceProducer();
145 surfaceProducer.setSize(SURFACE_WIDTH, SURFACE_HEIGHT);
146 flutterRenderer.attach(surfaceProducer.getSurface(), firstFrameLatch);
147 flutterRenderer.repaint();
148 textureId = surfaceProducer.id();
149
150 super.onFlutterUiDisplayed();
151 }
SurfaceProducer createSurfaceProducer()

◆ onPause()

void dev.flutter.scenarios.ExternalTextureFlutterActivity.onPause ( )
inline

Reimplemented from io.flutter.embedding.android.FlutterActivity.

Definition at line 135 of file ExternalTextureFlutterActivity.java.

135 {
136 flutterRenderer.destroy();
137 surfaceProducer.release();
138 super.onPause();
139 }

◆ waitUntilFlutterRendered()

void dev.flutter.scenarios.ExternalTextureFlutterActivity.waitUntilFlutterRendered ( )
inline

Reimplemented from dev.flutter.scenarios.TestableFlutterActivity.

Definition at line 90 of file ExternalTextureFlutterActivity.java.

90 {
91 super.waitUntilFlutterRendered();
92
93 try {
94 firstFrameLatch.await();
95 } catch (InterruptedException e) {
96 throw new RuntimeException(e);
97 }
98 }

Member Data Documentation

◆ TAG

final String dev.flutter.scenarios.ExternalTextureFlutterActivity.TAG = "Scenarios"
staticpackage

Definition at line 46 of file ExternalTextureFlutterActivity.java.


The documentation for this class was generated from the following file: