Commit 0a1fb5d8 authored by justin's avatar justin

pick from support 分支

parent eb4bb013
......@@ -127,12 +127,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@NonNull
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.v(TAG, "Creating FlutterView.");
flutterEngine.getActivityControlSurface().attachToActivity(
host.getActivity(),
host.getLifecycle()
);
mSyncer = FlutterBoost.instance().containerManager().generateSyncer(this);
ensureAlive();
......@@ -188,7 +191,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public void onPostResume() {
Log.v(TAG, "onPostResume()");
ensureAlive();
Utils.setStatusBarLightMode(host.getActivity(), true);
// Utils.setStatusBarLightMode(host.getActivity(), true);
}
......
......@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.Utils;
import com.idlefish.flutterboost.XFlutterView;
import io.flutter.embedding.android.*;
import io.flutter.embedding.engine.FlutterEngine;
......@@ -252,17 +253,9 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
configureStatusBarForFullscreenFlutterExperience();
return delegate.onCreateView(inflater, container, savedInstanceState);
}
private void configureStatusBarForFullscreenFlutterExperience() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = this.getActivity().getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
window.getDecorView().setSystemUiVisibility(PlatformPlugin.DEFAULT_SYSTEM_UI | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}
@Override
public void onStart() {
......@@ -278,6 +271,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
if (!isHidden()) {
delegate.onResume();
}
}
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible.
......
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