Commit efd7bf15 authored by Yacumima's avatar Yacumima

Merge branch 'flutter_1.5_upgrade_opt' of...

Merge branch 'flutter_1.5_upgrade_opt' of https://github.com/alibaba/flutter_boost into flutter_1.5_upgrade_opt
parents 1ebb42a9 db503d96
...@@ -71,12 +71,14 @@ ...@@ -71,12 +71,14 @@
- (void)pause - (void)pause
{ {
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.pause"]; [[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.paused"];
[self detach];
} }
- (void)resume - (void)resume
{ {
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resume"]; [[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
[(FLB2FlutterViewContainer *)_engine.viewController surfaceUpdated:YES];
} }
- (void)inactive - (void)inactive
...@@ -85,6 +87,7 @@ ...@@ -85,6 +87,7 @@
} }
- (FlutterEngine *)engine - (FlutterEngine *)engine
{ {
return _engine; return _engine;
......
...@@ -83,7 +83,7 @@ static NSUInteger kInstanceCounter = 0; ...@@ -83,7 +83,7 @@ static NSUInteger kInstanceCounter = 0;
{ {
kInstanceCounter++; kInstanceCounter++;
if(kInstanceCounter == 1){ if(kInstanceCounter == 1){
// [FLUTTER_APP resume]; [FLUTTER_APP resume];
} }
} }
...@@ -91,7 +91,7 @@ static NSUInteger kInstanceCounter = 0; ...@@ -91,7 +91,7 @@ static NSUInteger kInstanceCounter = 0;
{ {
kInstanceCounter--; kInstanceCounter--;
if([self.class instanceCounter] == 0){ if([self.class instanceCounter] == 0){
// [FLUTTER_APP pause]; [FLUTTER_APP pause];
} }
} }
...@@ -165,7 +165,6 @@ static NSUInteger kInstanceCounter = 0; ...@@ -165,7 +165,6 @@ static NSUInteger kInstanceCounter = 0;
[FLUTTER_APP resume]; [FLUTTER_APP resume];
[self surfaceUpdated:YES];
//For new page we should attach flutter view in view will appear //For new page we should attach flutter view in view will appear
//for better performance. //for better performance.
...@@ -189,7 +188,8 @@ static NSUInteger kInstanceCounter = 0; ...@@ -189,7 +188,8 @@ static NSUInteger kInstanceCounter = 0;
//Ensure flutter view is attached. //Ensure flutter view is attached.
[self attatchFlutterEngine]; [self attatchFlutterEngine];
[self surfaceUpdated:YES]; [FLUTTER_APP resume];
[BoostMessageChannel didShowPageContainer:^(NSNumber *result) {} [BoostMessageChannel didShowPageContainer:^(NSNumber *result) {}
pageName:_name pageName:_name
params:_params params:_params
...@@ -210,12 +210,14 @@ static NSUInteger kInstanceCounter = 0; ...@@ -210,12 +210,14 @@ static NSUInteger kInstanceCounter = 0;
- (void)viewDidDisappear:(BOOL)animated - (void)viewDidDisappear:(BOOL)animated
{ {
[self detatchFlutterEngine]; [super viewDidDisappear:animated];
[FLUTTER_APP resume];
[BoostMessageChannel didDisappearPageContainer:^(NSNumber *result) {} [BoostMessageChannel didDisappearPageContainer:^(NSNumber *result) {}
pageName:_name pageName:_name
params:_params params:_params
uniqueId:self.uniqueIDString]; uniqueId:self.uniqueIDString];
[super viewDidDisappear:animated];
} }
- (void)installSplashScreenViewIfNecessary { - (void)installSplashScreenViewIfNecessary {
......
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