android:use addIdelHandler to avoid call render callback before it is actually rendered

This commit is contained in:
pengfei.zhou 2020-04-27 15:09:52 +08:00 committed by osborn
parent c34fe50104
commit 12fcf71526

View File

@ -17,6 +17,8 @@ package pub.doric.plugin;
import android.app.Activity;
import android.os.Build;
import android.os.Looper;
import android.os.MessageQueue;
import android.text.TextUtils;
import android.util.Log;
@ -92,10 +94,11 @@ public class ShaderPlugin extends DoricJavaPlugin {
@Override
public void onFinish() {
getDoricContext().getRootNode().getNodeView().post(new Runnable() {
Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() {
@Override
public void run() {
public boolean queueIdle() {
promise.resolve();
return false;
}
});
}