Commit 0a1fb5d8 authored by justin's avatar justin

pick from support 分支

parent eb4bb013
...@@ -127,12 +127,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -127,12 +127,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@NonNull @NonNull
public 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(),
host.getLifecycle() host.getLifecycle()
); );
mSyncer = FlutterBoost.instance().containerManager().generateSyncer(this); mSyncer = FlutterBoost.instance().containerManager().generateSyncer(this);
ensureAlive(); ensureAlive();
...@@ -188,7 +191,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -188,7 +191,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public 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);
} }
......
...@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment; ...@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import com.idlefish.flutterboost.FlutterBoost; import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.Utils;
import com.idlefish.flutterboost.XFlutterView; import com.idlefish.flutterboost.XFlutterView;
import io.flutter.embedding.android.*; import io.flutter.embedding.android.*;
import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.FlutterEngine;
...@@ -252,17 +253,9 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm ...@@ -252,17 +253,9 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Nullable @Nullable
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
configureStatusBarForFullscreenFlutterExperience();
return delegate.onCreateView(inflater, container, savedInstanceState); 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 @Override
public void onStart() { public void onStart() {
...@@ -278,6 +271,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm ...@@ -278,6 +271,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
if (!isHidden()) { if (!isHidden()) {
delegate.onResume(); delegate.onResume();
} }
} }
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible. // 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