// Path: app/src/main/java/com/ximsfei/skindemo/bean/RecommendItem.java
// public class RecommendItem {
//     public String title;
//     public int indicator;
// 
//     public ImageItem item0;
//     public ImageItem item1;
//     public ImageItem item2;
//     public ImageItem item3;
//     public ImageItem item4;
//     public ImageItem item5;
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/baseadapter/BaseRecyclerViewAdapter.java
// public abstract class BaseRecyclerViewAdapter<T> extends RecyclerView.Adapter<BaseRecyclerViewHolder> {
// 
//     protected List<T> data = new ArrayList<>();
//     protected OnItemClickListener<T> listener;
// 
//     @Override
//     public void onBindViewHolder(BaseRecyclerViewHolder holder, final int position) {
//         holder.onBaseBindViewHolder(data.get(position), position);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return data.size();
//     }
// 
//     public void addAll(List<T> data) {
//         this.data.addAll(data);
//     }
// 
//     public void add(T object) {
//         data.add(object);
//     }
// 
//     public void clear() {
//         data.clear();
//     }
// 
//     public void remove(T object) {
//         data.remove(object);
//     }
// 
//     public void remove(int position) {
//         data.remove(position);
//     }
// 
//     public void removeAll(List<T> data) {
//         this.data.retainAll(data);
//     }
// 
//     public void setOnItemClickListener(OnItemClickListener<T> listener) {
//         this.listener = listener;
//     }
// 
//     public List<T> getData() {
//         return data;
//     }
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/baseadapter/BaseRecyclerViewHolder.java
// public abstract class BaseRecyclerViewHolder<T, D extends ViewDataBinding> extends RecyclerView.ViewHolder {
// 
//     public D mBinding;
// 
//     public BaseRecyclerViewHolder(ViewGroup viewGroup, int layoutId) {
//         super(DataBindingUtil.inflate(LayoutInflater.from(viewGroup.getContext()), layoutId, viewGroup, false).getRoot());
//         mBinding = DataBindingUtil.getBinding(this.itemView);
//     }
// 
//     /**
//      * @param bean     the data of bind
//      * @param position the item position of recyclerView
//      */
//     public abstract void onBindViewHolder(T bean, final int position);
// 
//     /**
//      * 当数据改变时，binding会在下一帧去改变数据，如果我们需要立即改变，就去调用executePendingBindings方法。
//      */
//     void onBaseBindViewHolder(T object, final int position) {
//         onBindViewHolder(object, position);
//         mBinding.executePendingBindings();
//     }
// }


import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.ximsfei.skindemo.R;
import com.ximsfei.skindemo.bean.RecommendItem;
import com.ximsfei.skindemo.databinding.RecommendItemBinding;
import com.ximsfei.skindemo.ui.adapter.baseadapter.BaseRecyclerViewAdapter;
import com.ximsfei.skindemo.ui.adapter.baseadapter.BaseRecyclerViewHolder;
package com.ximsfei.skindemo.ui.adapter;



/**
 * Created by ximsfei on 2017/1/15.
 */

public class RecommendAdapter extends BaseRecyclerViewAdapter<RecommendItem> {
    public static final int TYPE_SONG_MENU = 1;
    public static final int TYPE_UNIQUE = 2;
    public static final int TYPE_LASTEST = 3;
    public static final int TYPE_MV = 4;
    public static final int TYPE_RADIO = 5;

    public RecommendAdapter(Context context) {
    }

    @Override
    public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new RecommendItemViewHolder(parent, R.layout.recommend_item);
    }

    private class RecommendItemViewHolder extends BaseRecyclerViewHolder<RecommendItem, RecommendItemBinding> {
        public RecommendItemViewHolder(ViewGroup viewGroup, int layoutId) {
            super(viewGroup, layoutId);
        }

        @Override
        public void onBindViewHolder(RecommendItem item, int position) {
            mBinding.title.setText(item.title);
// Path: app/src/main/java/com/ximsfei/skindemo/bean/RecommendItem.java
// public class RecommendItem {
//     public String title;
//     public int indicator;
// 
//     public ImageItem item0;
//     public ImageItem item1;
//     public ImageItem item2;
//     public ImageItem item3;
//     public ImageItem item4;
//     public ImageItem item5;
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/baseadapter/BaseRecyclerViewAdapter.java
// public abstract class BaseRecyclerViewAdapter<T> extends RecyclerView.Adapter<BaseRecyclerViewHolder> {
// 
//     protected List<T> data = new ArrayList<>();
//     protected OnItemClickListener<T> listener;
// 
//     @Override
//     public void onBindViewHolder(BaseRecyclerViewHolder holder, final int position) {
//         holder.onBaseBindViewHolder(data.get(position), position);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return data.size();
//     }
// 
//     public void addAll(List<T> data) {
//         this.data.addAll(data);
//     }
// 
//     public void add(T object) {
//         data.add(object);
//     }
// 
//     public void clear() {
//         data.clear();
//     }
// 
//     public void remove(T object) {
//         data.remove(object);
//     }
// 
//     public void remove(int position) {
//         data.remove(position);
//     }
// 
//     public void removeAll(List<T> data) {
//         this.data.retainAll(data);
//     }
// 
//     public void setOnItemClickListener(OnItemClickListener<T> listener) {
//         this.listener = listener;
//     }
// 
//     public List<T> getData() {
//         return data;
//     }
// }
// 
// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/baseadapter/BaseRecyclerViewHolder.java
// public abstract class BaseRecyclerViewHolder<T, D extends ViewDataBinding> extends RecyclerView.ViewHolder {
// 
//     public D mBinding;
// 
//     public BaseRecyclerViewHolder(ViewGroup viewGroup, int layoutId) {
//         super(DataBindingUtil.inflate(LayoutInflater.from(viewGroup.getContext()), layoutId, viewGroup, false).getRoot());
//         mBinding = DataBindingUtil.getBinding(this.itemView);
//     }
// 
//     /**
//      * @param bean     the data of bind
//      * @param position the item position of recyclerView
//      */
//     public abstract void onBindViewHolder(T bean, final int position);
// 
//     /**
//      * 当数据改变时，binding会在下一帧去改变数据，如果我们需要立即改变，就去调用executePendingBindings方法。
//      */
//     void onBaseBindViewHolder(T object, final int position) {
//         onBindViewHolder(object, position);
//         mBinding.executePendingBindings();
//     }
// }


// Path: app/src/main/java/com/ximsfei/skindemo/ui/adapter/RecommendAdapter.java
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.ximsfei.skindemo.R;
import com.ximsfei.skindemo.bean.RecommendItem;
import com.ximsfei.skindemo.databinding.RecommendItemBinding;
import com.ximsfei.skindemo.ui.adapter.baseadapter.BaseRecyclerViewAdapter;
import com.ximsfei.skindemo.ui.adapter.baseadapter.BaseRecyclerViewHolder;

package com.ximsfei.skindemo.ui.adapter;



/**
 * Created by ximsfei on 2017/1/15.
 */

public class RecommendAdapter extends BaseRecyclerViewAdapter<RecommendItem> {
    public static final int TYPE_SONG_MENU = 1;
    public static final int TYPE_UNIQUE = 2;
    public static final int TYPE_LASTEST = 3;
    public static final int TYPE_MV = 4;
    public static final int TYPE_RADIO = 5;

    public RecommendAdapter(Context context) {
    }

    @Override
    public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new RecommendItemViewHolder(parent, R.layout.recommend_item);
    }

    private class RecommendItemViewHolder extends BaseRecyclerViewHolder<RecommendItem, RecommendItemBinding> {
        public RecommendItemViewHolder(ViewGroup viewGroup, int layoutId) {
            super(viewGroup, layoutId);
        }

        @Override
        public void onBindViewHolder(RecommendItem item, int position) {
            mBinding.title.setText(item.title);
            Context context = mBinding.recommend1.image.getContext();