use of com.taobao.weex.ui.component.WXLoading in project weex-example by KalicyZhou.
the class BasicListComponent method onBindViewHolder.
/**
* Bind the component of the position to the holder. Then flush the view.
*
* @param holder viewHolder, which holds reference to the view
* @param position position of component in WXListComponent
*/
@Override
public void onBindViewHolder(ListBaseViewHolder holder, int position) {
if (holder == null)
return;
holder.setComponentUsing(true);
WXComponent component = getChild(position);
if (component == null || (component instanceof WXRefresh) || (component instanceof WXLoading) || (component.getDomObject() != null && component.getDomObject().isFixed())) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "Bind WXRefresh & WXLoading " + holder);
}
return;
}
if (holder.getComponent() != null && holder.getComponent() instanceof WXCell) {
holder.getComponent().bindData(component);
// holder.getComponent().refreshData(component);
}
}
use of com.taobao.weex.ui.component.WXLoading 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);
}
}
Aggregations