Commit b5574fc6 authored by justin's avatar justin

开放自定义fragment等

parent 86ca1248
...@@ -57,11 +57,11 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -57,11 +57,11 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
protected IOperateSyncer mSyncer; protected IOperateSyncer mSyncer;
FlutterActivityAndFragmentDelegate(@NonNull Host host) { public FlutterActivityAndFragmentDelegate(@NonNull Host host) {
this.host = host; this.host = host;
} }
void release() { public void release() {
this.host = null; this.host = null;
this.flutterEngine = null; this.flutterEngine = null;
this.flutterView = null; this.flutterView = null;
...@@ -70,15 +70,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -70,15 +70,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@Nullable @Nullable
FlutterEngine getFlutterEngine() { public FlutterEngine getFlutterEngine() {
return flutterEngine; return flutterEngine;
} }
XFlutterView getFlutterView() { public XFlutterView getFlutterView() {
return flutterView; return flutterView;
} }
void onAttach(@NonNull Context context) { public void onAttach(@NonNull Context context) {
ensureAlive(); ensureAlive();
if (FlutterBoost.instance().platform().whenEngineStart() == FlutterBoost.ConfigBuilder.FLUTTER_ACTIVITY_CREATED) { if (FlutterBoost.instance().platform().whenEngineStart() == FlutterBoost.ConfigBuilder.FLUTTER_ACTIVITY_CREATED) {
FlutterBoost.instance().doInitialFlutter(); FlutterBoost.instance().doInitialFlutter();
...@@ -125,7 +125,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -125,7 +125,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@SuppressLint("ResourceType") @SuppressLint("ResourceType")
@NonNull @NonNull
View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.v(TAG, "Creating FlutterView."); Log.v(TAG, "Creating FlutterView.");
flutterEngine.getActivityControlSurface().attachToActivity( flutterEngine.getActivityControlSurface().attachToActivity(
host.getActivity(), host.getActivity(),
...@@ -154,7 +154,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -154,7 +154,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onStart() { public void onStart() {
Log.v(TAG, "onStart()"); Log.v(TAG, "onStart()");
ensureAlive(); ensureAlive();
...@@ -167,7 +167,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -167,7 +167,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onResume() { public void onResume() {
mSyncer.onAppear(); mSyncer.onAppear();
Log.v(TAG, "onResume()"); Log.v(TAG, "onResume()");
...@@ -185,7 +185,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -185,7 +185,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onPostResume() { public void onPostResume() {
Log.v(TAG, "onPostResume()"); Log.v(TAG, "onPostResume()");
ensureAlive(); ensureAlive();
Utils.setStatusBarLightMode(host.getActivity(), true); Utils.setStatusBarLightMode(host.getActivity(), true);
...@@ -193,7 +193,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -193,7 +193,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onPause() { public void onPause() {
Log.v(TAG, "onPause()"); Log.v(TAG, "onPause()");
ensureAlive(); ensureAlive();
...@@ -202,14 +202,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -202,14 +202,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onStop() { public void onStop() {
Log.v(TAG, "onStop()"); Log.v(TAG, "onStop()");
ensureAlive(); ensureAlive();
} }
void onDestroyView() { public void onDestroyView() {
Log.v(TAG, "onDestroyView()"); Log.v(TAG, "onDestroyView()");
mSyncer.onDestroy(); mSyncer.onDestroy();
...@@ -219,7 +219,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -219,7 +219,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onDetach() { public void onDetach() {
Log.v(TAG, "onDetach()"); Log.v(TAG, "onDetach()");
ensureAlive(); ensureAlive();
...@@ -236,14 +236,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -236,14 +236,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onBackPressed() { public void onBackPressed() {
mSyncer.onBackPressed(); mSyncer.onBackPressed();
ensureAlive(); ensureAlive();
} }
void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
mSyncer.onRequestPermissionsResult(requestCode, permissions, grantResults); mSyncer.onRequestPermissionsResult(requestCode, permissions, grantResults);
ensureAlive(); ensureAlive();
...@@ -259,7 +259,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -259,7 +259,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onNewIntent(@NonNull Intent intent) { public void onNewIntent(@NonNull Intent intent) {
mSyncer.onNewIntent(intent); mSyncer.onNewIntent(intent);
ensureAlive(); ensureAlive();
...@@ -272,7 +272,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -272,7 +272,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
mSyncer.onActivityResult(requestCode, resultCode, data); mSyncer.onActivityResult(requestCode, resultCode, data);
Map<String, Object> result = null; Map<String, Object> result = null;
if (data != null) { if (data != null) {
...@@ -298,7 +298,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -298,7 +298,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onUserLeaveHint() { public void onUserLeaveHint() {
ensureAlive(); ensureAlive();
if (flutterEngine != null) { if (flutterEngine != null) {
Log.v(TAG, "Forwarding onUserLeaveHint() to FlutterEngine."); Log.v(TAG, "Forwarding onUserLeaveHint() to FlutterEngine.");
...@@ -309,7 +309,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -309,7 +309,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
void onTrimMemory(int level) { public void onTrimMemory(int level) {
mSyncer.onTrimMemory(level); mSyncer.onTrimMemory(level);
ensureAlive(); ensureAlive();
...@@ -325,7 +325,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -325,7 +325,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
} }
} }
void onLowMemory() { public void onLowMemory() {
Log.v(TAG, "Forwarding onLowMemory() to FlutterEngine."); Log.v(TAG, "Forwarding onLowMemory() to FlutterEngine.");
mSyncer.onLowMemory(); mSyncer.onLowMemory();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment