use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXListComponent method createChildViewAt.
@Override
public void createChildViewAt(int index) {
int indexToCreate = index;
if (indexToCreate < 0) {
indexToCreate = childCount() - 1;
if (indexToCreate < 0) {
return;
}
}
final WXComponent child = getChild(indexToCreate);
if (child instanceof WXBaseRefresh) {
child.createView();
if (child instanceof WXRefresh) {
getHostView().setOnRefreshListener((WXRefresh) child);
getHostView().postDelayed(new Runnable() {
@Override
public void run() {
getHostView().setHeaderView(child);
}
}, 100);
} else if (child instanceof WXLoading) {
getHostView().setOnLoadingListener((WXLoading) child);
getHostView().postDelayed(new Runnable() {
@Override
public void run() {
getHostView().setFooterView(child);
}
}, 100);
}
} else {
super.createChildViewAt(indexToCreate);
}
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXDomStatement method invokeMethod.
void invokeMethod(String ref, String method, JSONArray args) {
if (mDestroy) {
return;
}
WXComponent comp = mWXRenderManager.getWXComponent(mInstanceId, ref);
if (comp == null) {
WXLogUtils.e("DomStatement", "target component not found.");
return;
}
comp.invoke(method, args);
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class SimpleComponentHolder method createInstance.
@Override
public synchronized WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent) throws IllegalAccessException, InvocationTargetException, InstantiationException {
WXComponent component = mCreator.createInstance(instance, node, parent);
component.bindHolder(this);
return component;
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXRenderStatement method setLayout.
/**
* set layout information of View
*/
void setLayout(String ref, WXDomObject domObject) {
WXComponent component = mRegistry.get(ref);
if (component == null) {
return;
}
component.setLayout(domObject);
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXRenderStatement method scrollTo.
/**
* @see com.taobao.weex.dom.WXDomStatement#scrollToDom(String, JSONObject)
*/
void scrollTo(String ref, Map<String, Object> options) {
WXComponent component = mRegistry.get(ref);
if (component == null) {
return;
}
Scrollable scroller = component.getParentScroller();
if (scroller == null) {
return;
}
scroller.scrollTo(component, options);
}
Aggregations