Search in sources :

Example 6 with BinderViewHolder

use of com.tmall.wireless.tangram3.core.adapter.BinderViewHolder in project Tangram-Android by alibaba.

the class BannerView method getFooterViewFromRecycler.

private View getFooterViewFromRecycler(@NonNull BaseCell cell) {
    GroupBasicAdapter adapter = cell.serviceManager.getService(GroupBasicAdapter.class);
    RecyclerView.RecycledViewPool pool = cell.serviceManager.getService(RecyclerView.RecycledViewPool.class);
    int itemViewType = adapter.getItemType(cell);
    BinderViewHolder holder = (BinderViewHolder) pool.getRecycledView(itemViewType);
    if (holder == null) {
        holder = (BinderViewHolder) adapter.createViewHolder(this, itemViewType);
    }
    holder.bind(cell);
    mFooterViewHolders.add(holder);
    return holder.itemView;
}
Also used : GroupBasicAdapter(com.tmall.wireless.tangram3.core.adapter.GroupBasicAdapter) BinderViewHolder(com.tmall.wireless.tangram3.core.adapter.BinderViewHolder) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)5 BinderViewHolder (com.tmall.wireless.tangram3.core.adapter.BinderViewHolder)5 GroupBasicAdapter (com.tmall.wireless.tangram3.core.adapter.GroupBasicAdapter)3 Range (com.alibaba.android.vlayout.Range)1 PageDetectorSupport (com.tmall.wireless.tangram3.support.PageDetectorSupport)1