diff --git a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java index 0a856e92..9751ff90 100644 --- a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java +++ b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java @@ -74,6 +74,13 @@ public class ShaderPlugin extends DoricJavaPlugin { viewNode.blend(jsObject.getProperty("props").asObject()); } } + Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() { + @Override + public boolean queueIdle() { + promise.resolve(); + return false; + } + }); return null; } }, ThreadMode.UI).setCallback(new AsyncResult.Callback() { @@ -94,13 +101,6 @@ public class ShaderPlugin extends DoricJavaPlugin { @Override public void onFinish() { - Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() { - @Override - public boolean queueIdle() { - promise.resolve(); - return false; - } - }); } }); }