use of com.taobao.weex.dom.WXDomTask in project weex-example by KalicyZhou.
the class WXComponent method updateStyleByPesudo.
private void updateStyleByPesudo(Map<String, Object> styles) {
Message message = Message.obtain();
WXDomTask task = new WXDomTask();
task.instanceId = getInstanceId();
task.args = new ArrayList<>();
JSONObject styleJson = new JSONObject(styles);
task.args.add(getRef());
task.args.add(styleJson);
//flag pesudo
task.args.add(true);
message.obj = task;
message.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE;
WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
}
use of com.taobao.weex.dom.WXDomTask in project weex-example by KalicyZhou.
the class WXAnimationModule method transition.
@JSMethod
public void transition(@Nullable String ref, @Nullable String animation, @Nullable String callBack) {
if (!TextUtils.isEmpty(ref) && !TextUtils.isEmpty(animation)) {
Message msg = Message.obtain();
WXDomTask task = new WXDomTask();
task.instanceId = mWXSDKInstance.getInstanceId();
task.args = new ArrayList<>();
task.args.add(ref);
task.args.add(animation);
task.args.add(callBack);
msg.what = WXDomHandler.MsgType.WX_ANIMATION;
msg.obj = task;
//Due to animation module rely on the result of the css-layout and the batch mechanism of
//css-layout, the animation.transition must be delayed the batch time.
WXSDKManager.getInstance().getWXDomManager().sendMessageDelayed(msg, WXDomHandler.DELAY_TIME);
}
}
use of com.taobao.weex.dom.WXDomTask in project weex-example by KalicyZhou.
the class WXSDKInstance method updateRootComponentStyle.
private void updateRootComponentStyle(JSONObject style) {
Message message = Message.obtain();
WXDomTask task = new WXDomTask();
task.instanceId = getInstanceId();
if (task.args == null) {
task.args = new ArrayList<>();
}
task.args.add(WXDomObject.ROOT);
task.args.add(style);
message.obj = task;
message.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE;
WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
}
use of com.taobao.weex.dom.WXDomTask in project weex-example by KalicyZhou.
the class WXComponent method appendEventToDOM.
/**
* Add new event to component,this will post a task to DOM thread to add event.
* @param type
*/
protected void appendEventToDOM(String type) {
Message message = Message.obtain();
WXDomTask task = new WXDomTask();
task.instanceId = getInstanceId();
task.args = new ArrayList<>();
task.args.add(getRef());
task.args.add(type);
message.obj = task;
message.what = WXDomHandler.MsgType.WX_DOM_ADD_EVENT;
WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
}
Aggregations