// Path: library/src/main/java/cn/droidlover/xdroid/base/SimpleRecBindingViewHolder.java
// public class SimpleRecBindingViewHolder<V extends ViewDataBinding> extends RecyclerView.ViewHolder {
//     private V binding;
// 
//     public SimpleRecBindingViewHolder(V binding) {
//         super(binding.getRoot());
//         this.binding = binding;
//     }
// 
//     public SimpleRecBindingViewHolder(View itemView) {
//         super(itemView);
//         this.binding = DataBindingUtil.bind(itemView);
//     }
// 
//     public V getBinding() {
//         return binding;
//     }
// }
// 
// Path: app/src/main/java/cn/droidlover/xdroid/demo/adapter/HomeAdapter.java
// public class HomeAdapter extends SimpleRecAdapter<GankResults.Item, SimpleRecBindingViewHolder<AdapterHomeBinding>> {
// 
//     public static final int TAG_VIEW = 0;
// 
//     public HomeAdapter(Context context) {
//         super(context);
//     }
// 
//     @Override
//     public SimpleRecBindingViewHolder newViewHolder(View itemView) {
//         return new SimpleRecBindingViewHolder(itemView);
//     }
// 
//     @Override
//     public int getLayoutId() {
//         return R.layout.adapter_home;
//     }
// 
//     @Override
//     public void onBindViewHolder(final SimpleRecBindingViewHolder<AdapterHomeBinding> holder, final int position) {
//         final GankResults.Item item = data.get(position);
// 
//         String type = item.getType();
//         switch (type) {
//             case "休息视频":
//                 holder.getBinding().rlMessage.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivPart.setVisibility(View.GONE);
//                 holder.getBinding().ivVedio.setVisibility(View.VISIBLE);
//                 holder.getBinding().tvItem.setText(item.getDesc());
//                 break;
//             case "福利":
//                 holder.getBinding().rlMessage.setVisibility(View.GONE);
//                 holder.getBinding().ivPart.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivVedio.setVisibility(View.GONE);
// 
//                 ILFactory.getLoader().loadNet(holder.getBinding().ivPart, item.getUrl(), null);
//                 holder.getBinding().tvItem.setText("瞧瞧妹纸，扩展扩展视野......");
//                 break;
//             default:
//                 holder.getBinding().rlMessage.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivPart.setVisibility(View.GONE);
//                 holder.getBinding().ivVedio.setVisibility(View.GONE);
//                 holder.getBinding().tvItem.setText(item.getDesc());
//                 break;
//         }
//         Uri uri = null;
//         switch (item.getType()) {
//             case "Android":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.android_icon);
//                 break;
//             case "iOS":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.ios_icon);
//                 break;
//             case "前端":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.js_icon);
//                 break;
//             case "拓展资源":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.other_icon);
//                 break;
//         }
// 
//         String author = item.getWho();
//         if (author != null) {
//             holder.getBinding().tvAuthor.setText(author);
//             holder.getBinding().tvAuthor.setTextColor(Color.parseColor("#87000000"));
//         } else {
//             holder.getBinding().tvAuthor.setText("");
//         }
// 
//         holder.getBinding().tvTime.setText(item.getCreatedAt());
// 
//         holder.getBinding().tvType.setText(type);
// 
//         holder.itemView.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if (getSimpleItemClick() != null) {
//                     getSimpleItemClick().onItemClick(position, item, TAG_VIEW, holder);
//                 }
//             }
//         });
// 
//     }
// 
// }


import cn.droidlover.xdroid.base.SimpleRecBindingViewHolder;
import cn.droidlover.xdroid.demo.adapter.HomeAdapter;
import cn.droidlover.xdroid.demo.databinding.AdapterHomeBinding;
import cn.droidlover.xdroid.demo.model.GankResults;
import cn.droidlover.xdroidbase.base.SimpleItemCallback;
import cn.droidlover.xdroidbase.base.SimpleRecAdapter;
import cn.droidlover.xrecyclerview.RecyclerItemCallback;
import cn.droidlover.xrecyclerview.XRecyclerView;
package cn.droidlover.xdroid.demo.ui;



/**
 * Created by wanglei on 2016/12/10.
 */

public class HomeFragment extends BasePagerFragment {

    HomeAdapter adapter;

    @Override
    public SimpleRecAdapter getAdapter() {
        if (adapter == null) {
            adapter = new HomeAdapter(context);
            adapter.setItemClick(new SimpleItemCallback<GankResults.Item,
// Path: library/src/main/java/cn/droidlover/xdroid/base/SimpleRecBindingViewHolder.java
// public class SimpleRecBindingViewHolder<V extends ViewDataBinding> extends RecyclerView.ViewHolder {
//     private V binding;
// 
//     public SimpleRecBindingViewHolder(V binding) {
//         super(binding.getRoot());
//         this.binding = binding;
//     }
// 
//     public SimpleRecBindingViewHolder(View itemView) {
//         super(itemView);
//         this.binding = DataBindingUtil.bind(itemView);
//     }
// 
//     public V getBinding() {
//         return binding;
//     }
// }
// 
// Path: app/src/main/java/cn/droidlover/xdroid/demo/adapter/HomeAdapter.java
// public class HomeAdapter extends SimpleRecAdapter<GankResults.Item, SimpleRecBindingViewHolder<AdapterHomeBinding>> {
// 
//     public static final int TAG_VIEW = 0;
// 
//     public HomeAdapter(Context context) {
//         super(context);
//     }
// 
//     @Override
//     public SimpleRecBindingViewHolder newViewHolder(View itemView) {
//         return new SimpleRecBindingViewHolder(itemView);
//     }
// 
//     @Override
//     public int getLayoutId() {
//         return R.layout.adapter_home;
//     }
// 
//     @Override
//     public void onBindViewHolder(final SimpleRecBindingViewHolder<AdapterHomeBinding> holder, final int position) {
//         final GankResults.Item item = data.get(position);
// 
//         String type = item.getType();
//         switch (type) {
//             case "休息视频":
//                 holder.getBinding().rlMessage.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivPart.setVisibility(View.GONE);
//                 holder.getBinding().ivVedio.setVisibility(View.VISIBLE);
//                 holder.getBinding().tvItem.setText(item.getDesc());
//                 break;
//             case "福利":
//                 holder.getBinding().rlMessage.setVisibility(View.GONE);
//                 holder.getBinding().ivPart.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivVedio.setVisibility(View.GONE);
// 
//                 ILFactory.getLoader().loadNet(holder.getBinding().ivPart, item.getUrl(), null);
//                 holder.getBinding().tvItem.setText("瞧瞧妹纸，扩展扩展视野......");
//                 break;
//             default:
//                 holder.getBinding().rlMessage.setVisibility(View.VISIBLE);
//                 holder.getBinding().ivPart.setVisibility(View.GONE);
//                 holder.getBinding().ivVedio.setVisibility(View.GONE);
//                 holder.getBinding().tvItem.setText(item.getDesc());
//                 break;
//         }
//         Uri uri = null;
//         switch (item.getType()) {
//             case "Android":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.android_icon);
//                 break;
//             case "iOS":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.ios_icon);
//                 break;
//             case "前端":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.js_icon);
//                 break;
//             case "拓展资源":
//                 holder.getBinding().ivType.setImageResource(R.mipmap.other_icon);
//                 break;
//         }
// 
//         String author = item.getWho();
//         if (author != null) {
//             holder.getBinding().tvAuthor.setText(author);
//             holder.getBinding().tvAuthor.setTextColor(Color.parseColor("#87000000"));
//         } else {
//             holder.getBinding().tvAuthor.setText("");
//         }
// 
//         holder.getBinding().tvTime.setText(item.getCreatedAt());
// 
//         holder.getBinding().tvType.setText(type);
// 
//         holder.itemView.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if (getSimpleItemClick() != null) {
//                     getSimpleItemClick().onItemClick(position, item, TAG_VIEW, holder);
//                 }
//             }
//         });
// 
//     }
// 
// }


// Path: app/src/main/java/cn/droidlover/xdroid/demo/ui/HomeFragment.java
import cn.droidlover.xdroid.base.SimpleRecBindingViewHolder;
import cn.droidlover.xdroid.demo.adapter.HomeAdapter;
import cn.droidlover.xdroid.demo.databinding.AdapterHomeBinding;
import cn.droidlover.xdroid.demo.model.GankResults;
import cn.droidlover.xdroidbase.base.SimpleItemCallback;
import cn.droidlover.xdroidbase.base.SimpleRecAdapter;
import cn.droidlover.xrecyclerview.RecyclerItemCallback;
import cn.droidlover.xrecyclerview.XRecyclerView;

package cn.droidlover.xdroid.demo.ui;



/**
 * Created by wanglei on 2016/12/10.
 */

public class HomeFragment extends BasePagerFragment {

    HomeAdapter adapter;

    @Override
    public SimpleRecAdapter getAdapter() {
        if (adapter == null) {
            adapter = new HomeAdapter(context);
            adapter.setItemClick(new SimpleItemCallback<GankResults.Item,
                    SimpleRecBindingViewHolder<AdapterHomeBinding>>() {