Search in sources :

Example 6 with GroupBasicAdapter

use of com.tmall.wireless.tangram.core.adapter.GroupBasicAdapter in project Tangram-Android by alibaba.

the class BannerView method getHeaderViewFromRecycler.

private View getHeaderViewFromRecycler(@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);
    mHeaderViewHolders.add(holder);
    return holder.itemView;
}
Also used : GroupBasicAdapter(com.tmall.wireless.tangram.core.adapter.GroupBasicAdapter) BinderViewHolder(com.tmall.wireless.tangram.core.adapter.BinderViewHolder) RecyclerView(android.support.v7.widget.RecyclerView)

Example 7 with GroupBasicAdapter

use of com.tmall.wireless.tangram.core.adapter.GroupBasicAdapter 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.tangram.core.adapter.GroupBasicAdapter) BinderViewHolder(com.tmall.wireless.tangram.core.adapter.BinderViewHolder) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)7 GroupBasicAdapter (com.tmall.wireless.tangram.core.adapter.GroupBasicAdapter)7 TargetApi (android.annotation.TargetApi)3 Handler (android.os.Handler)3 NonNull (android.support.annotation.NonNull)3 TextView (android.widget.TextView)3 Range (com.alibaba.android.vlayout.Range)3 BinderViewHolder (com.tmall.wireless.tangram.core.adapter.BinderViewHolder)3 Card (com.tmall.wireless.tangram.dataparser.concrete.Card)3 RatioTextView (com.tmall.wireless.tangram.example.data.RatioTextView)3 TestViewHolder (com.tmall.wireless.tangram.example.data.TestViewHolder)3 SampleClickSupport (com.tmall.wireless.tangram.example.support.SampleClickSupport)3 AsyncLoader (com.tmall.wireless.tangram.support.async.AsyncLoader)3 AsyncPageLoader (com.tmall.wireless.tangram.support.async.AsyncPageLoader)3 CardLoadSupport (com.tmall.wireless.tangram.support.async.CardLoadSupport)3 IInnerImageSetter (com.tmall.wireless.tangram.util.IInnerImageSetter)3 List (java.util.List)3 JSONArray (org.json.JSONArray)3 JSONException (org.json.JSONException)3 JSONObject (org.json.JSONObject)3