本文整理汇总了Java中com.taobao.weex.ui.view.listview.WXRecyclerView类的典型用法代码示例。如果您正苦于以下问题:Java WXRecyclerView类的具体用法?Java WXRecyclerView怎么用?Java WXRecyclerView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WXRecyclerView类属于com.taobao.weex.ui.view.listview包,在下文中一共展示了WXRecyclerView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLayoutType
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
public int getLayoutType(){
Object obj = get(Constants.Name.LAYOUT);
if (obj == null) {
return WXRecyclerView.TYPE_LINEAR_LAYOUT;
}
try {
switch(String.valueOf(obj)){
case Constants.Value.MULTI_COLUMN :
return WXRecyclerView.TYPE_STAGGERED_GRID_LAYOUT;
case Constants.Value.GRID :
return WXRecyclerView.TYPE_GRID_LAYOUT;
default:
return WXRecyclerView.TYPE_LINEAR_LAYOUT;
}
} catch (Exception e) {
WXLogUtils.e("[WXAttr] getLayoutType:", e);
}
return WXRecyclerView.TYPE_LINEAR_LAYOUT;
}
示例2: updateProperties
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public void updateProperties(Map<String, Object> props) {
super.updateProperties(props);
if(props.containsKey(Constants.Name.PADDING)
||props.containsKey(Constants.Name.PADDING_LEFT)
|| props.containsKey(Constants.Name.PADDING_RIGHT)){
if(mPaddingLeft !=mDomObject.getPadding().get(Spacing.LEFT)
|| mPaddingRight !=mDomObject.getPadding().get(Spacing.RIGHT)) {
markComponentUsable();
updateRecyclerAttr();
WXRecyclerView wxRecyclerView = getHostView().getInnerView();
wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
}
}
}
示例3: onHostViewInitialized
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
protected void onHostViewInitialized(T host) {
super.onHostViewInitialized(host);
WXRecyclerView recyclerView = host.getInnerView();
if (recyclerView == null || recyclerView.getAdapter() == null) {
WXLogUtils.e(TAG, "RecyclerView is not found or Adapter is not bound");
return;
}
if (mChildren == null) {
WXLogUtils.e(TAG, "children is null");
return;
}
mDragHelper = new DefaultDragHelper(mChildren, recyclerView, new EventTrigger() {
@Override
public void triggerEvent(String type, Map<String, Object> args) {
fireEvent(type, args);
}
});
mTriggerType = getTriggerType(getDomObject());
}
示例4: scrollTo
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public void scrollTo(WXComponent component,final int offset) {
if(bounceRecyclerView == null){
return;
}
WXComponent parent = component;
WXCell cell = null;
while(parent != null){
if(parent instanceof WXCell){
cell = (WXCell) parent;
break;
}
parent = parent.getParent();
}
if(cell !=null){
int pos = mChildren.indexOf(cell);
final WXRecyclerView view = bounceRecyclerView.getInnerView();
view.scrollToPosition(pos);
final WXComponent cellComp = cell;
//scroll cell to top
view.postDelayed(new Runnable() {
@Override
public void run() {
if(getOrientation() == Constants.Orientation.VERTICAL){
int scrollY = cellComp.getHostView().getTop()+offset;
view.smoothScrollBy(0,scrollY );
}else{
int scrollX = cellComp.getHostView().getLeft()+offset;
view.smoothScrollBy(scrollX,0);
}
}
},50);
onPostScrollToPosition(pos);
}
}
示例5: findFirstListByRootView
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
public static View findFirstListByRootView(View rootView){
View firstListView = null;
if(null != rootView){
allViews = ViewUtil.getAllChildViews(rootView);
for (View view:allViews
) {
if(view instanceof WXRecyclerView){
firstListView = view;
break;
}
}
}
return firstListView;
}
示例6: WXListComponent
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
public WXListComponent(WXSDKInstance instance, WXDomObject node, WXVContainer parent, boolean lazy) {
super(instance, node, parent);
if (node != null && node instanceof WXRecyclerDomObject) {
mDomObject = (WXRecyclerDomObject) node;
mDomObject.preCalculateCellWidth();
if(WXBasicComponentType.WATERFALL.equals(node.getType())){
mLayoutType = WXRecyclerView.TYPE_STAGGERED_GRID_LAYOUT;
}else{
mLayoutType = mDomObject.getLayoutType();
}
updateRecyclerAttr();
}
}
示例7: setColumnWidth
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@WXComponentProp(name = Constants.Name.COLUMN_WIDTH)
public void setColumnWidth(int columnCount) {
if(mDomObject.getColumnWidth() != mColumnWidth){
markComponentUsable();
updateRecyclerAttr();
WXRecyclerView wxRecyclerView = getHostView().getInnerView();
wxRecyclerView.initView(getContext(), mLayoutType,mColumnCount,mColumnGap,getOrientation());
}
}
示例8: setColumnCount
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@WXComponentProp(name = Constants.Name.COLUMN_COUNT)
public void setColumnCount(int columnCount){
if(mDomObject.getColumnCount() != mColumnCount){
markComponentUsable();
updateRecyclerAttr();
WXRecyclerView wxRecyclerView = getHostView().getInnerView();
wxRecyclerView.initView(getContext(), mLayoutType,mColumnCount,mColumnGap,getOrientation());
}
}
示例9: setColumnGap
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@WXComponentProp(name = Constants.Name.COLUMN_GAP)
public void setColumnGap(float columnGap) throws InterruptedException {
if(mDomObject.getColumnGap() != mColumnGap) {
markComponentUsable();
updateRecyclerAttr();
WXRecyclerView wxRecyclerView = getHostView().getInnerView();
wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
}
}
示例10: setScrollable
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@WXComponentProp(name = Constants.Name.SCROLLABLE)
public void setScrollable(boolean scrollable) {
this.isScrollable = scrollable;
WXRecyclerView inner = getHostView().getInnerView();
if(inner != null) {
inner.setScrollable(scrollable);
}
}
示例11: setScrollable
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@WXComponentProp(name = Constants.Name.SCROLLABLE)
public void setScrollable(boolean scrollable) {
View inner = getHostView().getInnerView();
if (inner instanceof WXRecyclerView) {
((WXRecyclerView) inner).setScrollable(scrollable);
}
;
}
示例12: computeComponentContentHeight
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
static int computeComponentContentHeight(@NonNull WXComponent component) {
View view = component.getHostView();
if(view == null) {
return 0;
}
if(component instanceof WXListComponent) {
WXListComponent listComponent = (WXListComponent) component;
BounceRecyclerView bounceRecyclerView = listComponent.getHostView();
if(bounceRecyclerView == null) {
return 0;
}
WXRecyclerView innerView = bounceRecyclerView.getInnerView();
if(innerView == null) {
return bounceRecyclerView.getMeasuredHeight();
} else {
return innerView.computeVerticalScrollRange();
}
} else if(component instanceof WXScroller) {
WXScroller scroller = (WXScroller) component;
if(!ViewUtils.isVerticalScroller(scroller)) {
return view.getMeasuredHeight();
}
ViewGroup group = scroller.getInnerView();
if(group == null) {
return view.getMeasuredHeight();
}
if(group.getChildCount() != 1) {
return view.getMeasuredHeight();
} else {
return group.getChildAt(0).getMeasuredHeight();
}
} else {
return view.getMeasuredHeight();
}
}
示例13: setInnerView
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public WXRecyclerView setInnerView(Context context) {
WXRecyclerView wxRecyclerView = new WXRecyclerView(context);
wxRecyclerView.initView(context, WXRecyclerView.TYPE_LINEAR_LAYOUT, getOrientation());
return wxRecyclerView;
}
示例14: setInnerView
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public WXRecyclerView setInnerView(Context context) {
WXRecyclerView wxRecyclerView = new WXRecyclerView(context);
wxRecyclerView.initView(context, mLayoutType,mColumnCount,mColumnGap,getOrientation());
return wxRecyclerView;
}
示例15: getInnerView
import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public WXRecyclerView getInnerView() {
return this;
}