Commit ddd9ff84 authored by justin's avatar justin

解决Top页面在绑定engine 后,被底下页面detach engine ,导致白屏问题卡死问题

parent 662e2aa4
...@@ -66,6 +66,14 @@ public class ContainerRecord implements IContainerRecord { ...@@ -66,6 +66,14 @@ public class ContainerRecord implements IContainerRecord {
return mState; return mState;
} }
@Override
public boolean isLock(){
IContainerRecord record=mManager.getCurrentTopRecord();
if(record==this ||record==null ) return false;
return true;
}
@Override @Override
public void onCreate() { public void onCreate() {
Utils.assertCallOnMainThread(); Utils.assertCallOnMainThread();
...@@ -211,6 +219,7 @@ public class ContainerRecord implements IContainerRecord { ...@@ -211,6 +219,7 @@ public class ContainerRecord implements IContainerRecord {
} }
} }
private void appear() { private void appear() {
invokeChannelUnsafe("didShowPageContainer", invokeChannelUnsafe("didShowPageContainer",
mContainer.getContainerUrl(), mContainer.getContainerUrl(),
......
...@@ -23,6 +23,7 @@ import com.idlefish.flutterboost.FlutterBoost; ...@@ -23,6 +23,7 @@ import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.Utils; import com.idlefish.flutterboost.Utils;
import com.idlefish.flutterboost.XFlutterView; import com.idlefish.flutterboost.XFlutterView;
import com.idlefish.flutterboost.XPlatformPlugin; import com.idlefish.flutterboost.XPlatformPlugin;
import com.idlefish.flutterboost.interfaces.IContainerRecord;
import com.idlefish.flutterboost.interfaces.IFlutterViewContainer; import com.idlefish.flutterboost.interfaces.IFlutterViewContainer;
import com.idlefish.flutterboost.interfaces.IOperateSyncer; import com.idlefish.flutterboost.interfaces.IOperateSyncer;
import io.flutter.Log; import io.flutter.Log;
...@@ -164,6 +165,8 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -164,6 +165,8 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public void onResume() { public void onResume() {
if(mSyncer.isLock()) return;
mSyncer.onAppear(); mSyncer.onAppear();
Log.v(TAG, "onResume()"); Log.v(TAG, "onResume()");
...@@ -196,7 +199,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -196,7 +199,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public void onPause() { public void onPause() {
Log.v(TAG, "onPause()"); Log.v(TAG, "onPause()");
if(mSyncer.isLock()) return;
ensureAlive(); ensureAlive();
mSyncer.onDisappear(); mSyncer.onDisappear();
flutterEngine.getLifecycleChannel().appIsInactive(); flutterEngine.getLifecycleChannel().appIsInactive();
......
...@@ -5,6 +5,7 @@ import android.content.Intent; ...@@ -5,6 +5,7 @@ import android.content.Intent;
import java.util.Map; import java.util.Map;
public interface IOperateSyncer { public interface IOperateSyncer {
boolean isLock();
void onCreate(); void onCreate();
...@@ -29,4 +30,5 @@ public interface IOperateSyncer { ...@@ -29,4 +30,5 @@ public interface IOperateSyncer {
void onTrimMemory(int level); void onTrimMemory(int level);
void onLowMemory(); void onLowMemory();
} }
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