use of com.taobao.weex.ui.component.list.template.WXRecyclerTemplateList in project incubator-weex by apache.
the class UpdateComponentDataAction method executeRender.
@Override
public void executeRender(RenderActionContext context) {
String ref = CellDataManager.getListRef(virtualComponentId);
if (TextUtils.isEmpty(ref)) {
WXLogUtils.e("wrong virtualComponentId split error " + virtualComponentId);
return;
}
WXComponent component = context.getComponent(ref);
if (component instanceof WXRecyclerTemplateList) {
WXRecyclerTemplateList templateList = (WXRecyclerTemplateList) component;
templateList.getCellDataManager().updateVirtualComponentData(virtualComponentId, data);
templateList.notifyUpdateList();
SimpleJSCallback jsCallback = new SimpleJSCallback(component.getInstanceId(), callback);
jsCallback.invoke(true);
} else {
WXLogUtils.e("recycler-list wrong virtualComponentId " + virtualComponentId);
}
}
use of com.taobao.weex.ui.component.list.template.WXRecyclerTemplateList in project incubator-weex by apache.
the class WXParallax method onScrolled.
@Override
public void onScrolled(View view, int dx, int dy) {
if (ViewCompat.isInLayout(view)) {
if (mBindingComponent == null && mBindingRef != null) {
mBindingComponent = findComponent(mBindingRef);
}
if (mBindingComponent instanceof BasicListComponent && view instanceof RecyclerView) {
BasicListComponent listComponent = (BasicListComponent) mBindingComponent;
mOffsetY = Math.abs(listComponent.calcContentOffset((RecyclerView) view));
} else if (mBindingComponent instanceof WXRecyclerTemplateList && view instanceof RecyclerView) {
WXRecyclerTemplateList listComponent = (WXRecyclerTemplateList) mBindingComponent;
mOffsetY = Math.abs(listComponent.calcContentOffset((RecyclerView) view));
}
} else {
mOffsetY = mOffsetY + dy;
}
AnimationSet animationSet = new AnimationSet(true);
boolean hasAnimation = false;
for (int i = 0; i < mTransformPropArrayList.size(); i++) {
TransformCreator creator = mTransformPropArrayList.get(i);
Animation animation = creator.getAnimation(dx, dy);
if (animation != null) {
animationSet.addAnimation(animation);
hasAnimation = true;
}
}
if (hasAnimation) {
animationSet.setFillAfter(true);
if (getHostView() != null) {
getHostView().startAnimation(animationSet);
}
}
if (mBackgroundColor != null) {
int color = mBackgroundColor.getColor(dx, dy);
if (mBackGroundColor != color) {
getHostView().setBackgroundColor(color);
mBackGroundColor = color;
}
}
}
Aggregations