当前位置: 首页>>代码示例>>Java>>正文


Java WXRecyclerView类代码示例

本文整理汇总了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;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:21,代码来源:WXAttr.java

示例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());
    }
  }

}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:19,代码来源:WXListComponent.java

示例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());
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:25,代码来源:BasicListComponent.java

示例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);
  }

}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:39,代码来源:WXListComponent.java

示例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;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:15,代码来源:ScreenShot.java

示例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();

  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:16,代码来源:WXListComponent.java

示例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());
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:10,代码来源:WXListComponent.java

示例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());
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:10,代码来源:WXListComponent.java

示例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());
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:10,代码来源:WXListComponent.java

示例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);
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:9,代码来源:BasicListComponent.java

示例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);
  }
  ;
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:9,代码来源:BasicListComponent.java

示例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();
    }
}
 
开发者ID:weexteam,项目名称:weex-analyzer-android,代码行数:36,代码来源:ComponentHeightComputer.java

示例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;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:7,代码来源:BounceRecyclerView.java

示例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;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:7,代码来源:BounceRecyclerView.java

示例15: getInnerView

import com.taobao.weex.ui.view.listview.WXRecyclerView; //导入依赖的package包/类
@Override
public WXRecyclerView getInnerView() {
  return this;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:5,代码来源:SimpleRecyclerView.java


注:本文中的com.taobao.weex.ui.view.listview.WXRecyclerView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。