Search in sources :

Example 6 with WXRecyclerView

use of com.taobao.weex.ui.view.listview.WXRecyclerView in project incubator-weex by apache.

the class WXRecyclerTemplateList method setColumnCount.

@WXComponentProp(name = Constants.Name.COLUMN_COUNT)
public void setColumnCount(int columnCount) {
    if (mDomObject.getColumnCount() != mColumnCount) {
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 7 with WXRecyclerView

use of com.taobao.weex.ui.view.listview.WXRecyclerView in project incubator-weex by apache.

the class WXRecyclerTemplateList method setScrollDirection.

@WXComponentProp(name = Constants.Name.SCROLL_DIRECTION)
public void setScrollDirection(String direction) {
    if (orientation != mDomObject.getOrientation()) {
        orientation = mDomObject.getOrientation();
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 8 with WXRecyclerView

use of com.taobao.weex.ui.view.listview.WXRecyclerView in project incubator-weex by apache.

the class WXRecyclerTemplateList method updateProperties.

@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)) {
            updateRecyclerAttr();
            WXRecyclerView wxRecyclerView = getHostView().getInnerView();
            wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
        }
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView)

Example 9 with WXRecyclerView

use of com.taobao.weex.ui.view.listview.WXRecyclerView in project incubator-weex by apache.

the class WXRecyclerTemplateList method onHostViewInitialized.

@Override
protected void onHostViewInitialized(BounceRecyclerView 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;
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView)

Example 10 with WXRecyclerView

use of com.taobao.weex.ui.view.listview.WXRecyclerView in project incubator-weex by apache.

the class WXListComponent method setRightGap.

@WXComponentProp(name = Constants.Name.RIGHT_GAP)
public void setRightGap(float rightGap) {
    if (mRecyclerDom != null && mRecyclerDom.getRightGap() != mRightGap) {
        markComponentUsable();
        mRecyclerDom.preCalculateCellWidth();
        updateRecyclerAttr();
        WXRecyclerView wxRecyclerView = getHostView().getInnerView();
        wxRecyclerView.initView(getContext(), mLayoutType, mColumnCount, mColumnGap, getOrientation());
    }
}
Also used : WXRecyclerView(com.taobao.weex.ui.view.listview.WXRecyclerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Aggregations

WXRecyclerView (com.taobao.weex.ui.view.listview.WXRecyclerView)26 WXComponentProp (com.taobao.weex.ui.component.WXComponentProp)13 Point (android.graphics.Point)7 RecyclerView (android.support.v7.widget.RecyclerView)4 BounceRecyclerView (com.taobao.weex.ui.view.refresh.wrapper.BounceRecyclerView)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)3 ArrayMap (android.support.v4.util.ArrayMap)2 GridLayoutManager (android.support.v7.widget.GridLayoutManager)2 WXComponent (com.taobao.weex.ui.component.WXComponent)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 JSMethod (com.taobao.weex.annotation.JSMethod)1 WXRuntimeException (com.taobao.weex.common.WXRuntimeException)1 WXCell (com.taobao.weex.ui.component.list.WXCell)1