You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/04/15 07:25:23 UTC
[GitHub] [incubator-weex] wangxiongtao opened a new issue #2317: [Android]自定义WXVContainer时使用fireEvent自定义事件weex页面不响应事件,用fireGlobalEventCallback可以
wangxiongtao opened a new issue #2317: [Android]自定义WXVContainer时使用fireEvent自定义事件weex页面不响应事件,用fireGlobalEventCallback可以
URL: https://github.com/apache/incubator-weex/issues/2317
Android 代码
@Component(lazyload = false)
public class WXRefreshLayout extends WXVContainer<DCRefreshLayout> {
private LinearLayout refreshLl;
public WXRefreshLayout(WXSDKInstance instance, WXVContainer parent, BasicComponentData basicComponentData) {
super(instance, parent, basicComponentData);
}
@Override
protected DCRefreshLayout initComponentHostView(@NonNull Context context) {
DCRefreshLayout linearLayout = (DCRefreshLayout) View.inflate(context, R.layout.weex_refresh_layout, null);
refreshLl = linearLayout.findViewById(R.id.refresh_ll);
linearLayout.setOnRefreshAndLoadMoreListener(new OnRefreshAndLoadMoreListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
getInstance().fireGlobalEventCallback("onRefresh",null);
}
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
fireEvent("onLoadMore");
}
});
return linearLayout;
}
}
weex 代码:<refresh-layout ref="refresh" @onLoadMore="onLoadMore"/>
onLoadMore事件不响应
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services