Commit 77af051a authored by yangwu.jia's avatar yangwu.jia

Brightness.light 问题修复

parent a8ba6798
...@@ -175,6 +175,7 @@ public class ContainerRecord implements IContainerRecord { ...@@ -175,6 +175,7 @@ public class ContainerRecord implements IContainerRecord {
@Override @Override
public void onContainerResult(int requestCode, int resultCode, Map<String, Object> result) { public void onContainerResult(int requestCode, int resultCode, Map<String, Object> result) {
mManager.setContainerResult(this, requestCode,resultCode, result);
} }
...@@ -192,41 +193,6 @@ public class ContainerRecord implements IContainerRecord { ...@@ -192,41 +193,6 @@ public class ContainerRecord implements IContainerRecord {
public void onLowMemory() { public void onLowMemory() {
} }
//
// @Override
// public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
// mContainer.getBoostFlutterView().onRequestPermissionsResult(requestCode, permissions, grantResults);
// }
//
// @Override
// public void onNewIntent(Intent intent) {
// mContainer.getBoostFlutterView().onNewIntent(intent);
// }
//
// @Override
// public void onActivityResult(int requestCode, int resultCode, Intent data) {
// mContainer.getBoostFlutterView().onActivityResult(requestCode, resultCode, data);
// }
//
// @Override
// public void onContainerResult(int requestCode, int resultCode, Map<String, Object> result) {
// mManager.setContainerResult(this, requestCode,resultCode, result);
// }
//
// @Override
// public void onUserLeaveHint() {
// mContainer.getBoostFlutterView().onUserLeaveHint();
// }
//
// @Override
// public void onTrimMemory(int level) {
// mContainer.getBoostFlutterView().onTrimMemory(level);
// }
//
// @Override
// public void onLowMemory() {
// mContainer.getBoostFlutterView().onLowMemory();
// }
private class MethodChannelProxy { private class MethodChannelProxy {
......
...@@ -15,6 +15,7 @@ import android.view.ViewGroup; ...@@ -15,6 +15,7 @@ import android.view.ViewGroup;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -111,6 +112,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine ...@@ -111,6 +112,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine
host.getLifecycle() host.getLifecycle()
); );
} }
host.configureFlutterEngine(flutterEngine); host.configureFlutterEngine(flutterEngine);
...@@ -190,16 +192,8 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine ...@@ -190,16 +192,8 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine
void onPostResume() { void onPostResume() {
Log.v(TAG, "onPostResume()"); Log.v(TAG, "onPostResume()");
ensureAlive(); ensureAlive();
if (flutterEngine != null) { Utils.setStatusBarLightMode(host.getActivity(),true);
if (platformPlugin != null) {
// TODO(mattcarroll): find a better way to handle the update of UI overlays than calling through
// to platformPlugin. We're implicitly entangling the Window, Activity, Fragment,
// and engine all with this one call.
platformPlugin.updateSystemUiOverlays();
}
} else {
Log.w(TAG, "onPostResume() invoked before NewFlutterFragment was attached to an Activity.");
}
} }
...@@ -372,10 +366,26 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine ...@@ -372,10 +366,26 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine
@Override @Override
public void finishContainer(Map<String, Object> result) { public void finishContainer(Map<String, Object> result) {
this.host.finishContainer(result);
if(result != null) {
setBoostResult(this.host.getActivity(),new HashMap<>(result));
this.host.getActivity().finish();
}else{
this.host.getActivity().finish();
}
} }
public void setBoostResult(Activity activity, HashMap result) {
Intent intent = new Intent();
if (result != null) {
intent.putExtra(IFlutterViewContainer.RESULT_KEY, result);
}
activity.setResult(Activity.RESULT_OK, intent);
}
@Override @Override
public String getContainerUrl() { public String getContainerUrl() {
return this.host.getContainerUrl(); return this.host.getContainerUrl();
...@@ -473,7 +483,6 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine ...@@ -473,7 +483,6 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContaine
void finishContainer(Map<String, Object> result) ;
String getContainerUrl() ; String getContainerUrl() ;
......
...@@ -241,7 +241,8 @@ public class NewBoostFlutterActivity extends Activity ...@@ -241,7 +241,8 @@ public class NewBoostFlutterActivity extends Activity
window.setStatusBarColor(Color.TRANSPARENT); window.setStatusBarColor(Color.TRANSPARENT);
window.getDecorView().setSystemUiVisibility(PlatformPlugin.DEFAULT_SYSTEM_UI); window.getDecorView().setSystemUiVisibility(PlatformPlugin.DEFAULT_SYSTEM_UI);
} }
Utils.setStatusBarLightMode(this,true);
} }
...@@ -469,12 +470,6 @@ public class NewBoostFlutterActivity extends Activity ...@@ -469,12 +470,6 @@ public class NewBoostFlutterActivity extends Activity
@Override
public void finishContainer(Map<String, Object> result) {
Activity activity= this.getActivity();
activity.finish();
}
@Override @Override
public String getContainerUrl() { public String getContainerUrl() {
......
...@@ -489,12 +489,7 @@ public class NewFlutterFragment extends Fragment implements FlutterActivityAndFr ...@@ -489,12 +489,7 @@ public class NewFlutterFragment extends Fragment implements FlutterActivityAndFr
} }
@Override
public void finishContainer(Map<String, Object> result) {
Activity activity = this.getActivity();
activity.finish();
}
@Override @Override
public String getContainerUrl() { public String getContainerUrl() {
......
...@@ -108,6 +108,10 @@ class _FlutterRouteWidgetState extends State<FlutterRouteWidget> { ...@@ -108,6 +108,10 @@ class _FlutterRouteWidgetState extends State<FlutterRouteWidget> {
final String message=widget.message; final String message=widget.message;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
brightness:Brightness.light,
backgroundColor: Colors.white,
textTheme:new TextTheme(title: TextStyle(color: Colors.black)) ,
title: Text('flutter_boost_example'), title: Text('flutter_boost_example'),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
......
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