Commit ed67f08b authored by justin's avatar justin

开放自定义fragment等

parent 15d14148
......@@ -57,11 +57,11 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
protected IOperateSyncer mSyncer;
FlutterActivityAndFragmentDelegate(@NonNull Host host) {
public FlutterActivityAndFragmentDelegate(@NonNull Host host) {
this.host = host;
}
void release() {
public void release() {
this.host = null;
this.flutterEngine = null;
this.flutterView = null;
......@@ -70,15 +70,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@Nullable
FlutterEngine getFlutterEngine() {
public FlutterEngine getFlutterEngine() {
return flutterEngine;
}
XFlutterView getFlutterView() {
public XFlutterView getFlutterView() {
return flutterView;
}
void onAttach(@NonNull Context context) {
public void onAttach(@NonNull Context context) {
ensureAlive();
if (FlutterBoost.instance().platform().whenEngineStart() == FlutterBoost.ConfigBuilder.FLUTTER_ACTIVITY_CREATED) {
FlutterBoost.instance().doInitialFlutter();
......@@ -125,7 +125,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@SuppressLint("ResourceType")
@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.");
flutterEngine.getActivityControlSurface().attachToActivity(
host.getActivity(),
......@@ -154,7 +154,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onStart() {
public void onStart() {
Log.v(TAG, "onStart()");
ensureAlive();
......@@ -167,7 +167,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onResume() {
public void onResume() {
mSyncer.onAppear();
Log.v(TAG, "onResume()");
......@@ -185,7 +185,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onPostResume() {
public void onPostResume() {
Log.v(TAG, "onPostResume()");
ensureAlive();
Utils.setStatusBarLightMode(host.getActivity(), true);
......@@ -193,7 +193,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onPause() {
public void onPause() {
Log.v(TAG, "onPause()");
ensureAlive();
......@@ -202,14 +202,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onStop() {
public void onStop() {
Log.v(TAG, "onStop()");
ensureAlive();
}
void onDestroyView() {
public void onDestroyView() {
Log.v(TAG, "onDestroyView()");
mSyncer.onDestroy();
......@@ -219,7 +219,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onDetach() {
public void onDetach() {
Log.v(TAG, "onDetach()");
ensureAlive();
......@@ -236,14 +236,14 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onBackPressed() {
public void onBackPressed() {
mSyncer.onBackPressed();
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);
ensureAlive();
......@@ -259,7 +259,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onNewIntent(@NonNull Intent intent) {
public void onNewIntent(@NonNull Intent intent) {
mSyncer.onNewIntent(intent);
ensureAlive();
......@@ -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);
Map<String, Object> result = null;
if (data != null) {
......@@ -298,7 +298,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onUserLeaveHint() {
public void onUserLeaveHint() {
ensureAlive();
if (flutterEngine != null) {
Log.v(TAG, "Forwarding onUserLeaveHint() to FlutterEngine.");
......@@ -309,7 +309,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
void onTrimMemory(int level) {
public void onTrimMemory(int level) {
mSyncer.onTrimMemory(level);
ensureAlive();
......@@ -325,7 +325,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
}
}
void onLowMemory() {
public void onLowMemory() {
Log.v(TAG, "Forwarding onLowMemory() to FlutterEngine.");
mSyncer.onLowMemory();
......@@ -338,7 +338,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
* <p>
* An {@code IllegalStateException} is thrown if this delegate has been {@link #release()}'ed.
*/
private void ensureAlive() {
private void ensureAlive() {
if (host == null) {
throw new IllegalStateException("Cannot execute method on a destroyed FlutterActivityAndFragmentDelegate.");
}
......
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