// Path: app/src/main/java/me/wavever/ganklock/event/ClickEvent.java
// public class ClickEvent {
// 
//     public static final int CLICK_TYPE_DAILY_PHOTO = 0;
//     public static final int CLICK_TYPE_DAILY_TITLE = 1;
// 
//     public static final int CLICK_TYPE_MEIZHI = 2;
// 
//     public static final int CLICK_TYPE_LIKE = 3;
// 
//     public int eventType;
// 
//     public GankDaily gankDaily;
// 
//     public int position;
// 
//     public ClickEvent(int eventType,GankDaily gankDaily) {
//         this.eventType = eventType;
//         this.gankDaily = gankDaily;
//     }
// 
//     public ClickEvent(int eventType,int position) {
//         this.eventType = eventType;
//         this.position = position;
//     }
// 
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/event/RxBus.java
// public class RxBus {
// 
//     private static volatile RxBus instance;
// 
//     private final SerializedSubject<Object, Object> subject;
// 
//     private RxBus() {
//         subject = new SerializedSubject<>(PublishSubject.create());
//     }
// 
//     /**
//      * 单例模式获取RxBus
//      *
//      * @return
//      */
//     public static RxBus getInstance() {
//         RxBus rxBus = instance;
//         if (instance == null) {
//             synchronized (RxBus.class) {
//                 rxBus = instance;
//                 if (instance == null) {
//                     rxBus = new RxBus();
//                     instance = rxBus;
//                 }
//             }
//         }
//         return rxBus;
//     }
// 
//     /**
//      * 发送一个新的事件
//      *
//      * @param object
//      */
//     public void post(Object object) {
//         subject.onNext(object);
//     }
// 
//     /**
//      * 根据传递的eventType类型返回特定的被观察者
//      * @param eventType
//      * @param <T>
//      * @return
//      */
//     public <T> Observable<T> tObservable(Class<T> eventType) {
//         return subject.ofType(eventType);
//     }
// 
//     public boolean hasObservers() {
//         return subject.hasObservers();
//     }
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/ui/adapter/MeizhiRecyclerViewAdapter.java
// class MeizhiViewHolder extends ViewHolder {
// 
//     ImageView img;
//     int position;
// 
//     public MeizhiViewHolder(View itemView) {
//         super(itemView);
//         img = (ImageView) itemView.findViewById(R.id.item_photo);
//         img.setOnClickListener(new View.OnClickListener() {
//             @Override public void onClick(View v) {
//                 RxBus.getInstance()
//                     .post(new ClickEvent(ClickEvent.CLICK_TYPE_MEIZHI, position));
//             }
//         });
//     }
// }


import android.content.Context;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.util.List;
import me.wavever.ganklock.R;
import me.wavever.ganklock.event.ClickEvent;
import me.wavever.ganklock.event.RxBus;
import me.wavever.ganklock.ui.adapter.MeizhiRecyclerViewAdapter.MeizhiViewHolder;
    @Override
    public MeizhiViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.item_meizhi_recycler_view, parent, false);
        return new MeizhiViewHolder(view);
    }

    @Override
    public void onBindViewHolder(MeizhiViewHolder holder, int position) {
        holder.position = position;
        Picasso.with(mContext).load(mList.get(position)).resize(300,300).centerCrop().into(holder.img);
    }


    @Override public int getItemCount() {
        return mList == null ? 0 : mList.size();
    }


    class MeizhiViewHolder extends ViewHolder {

        ImageView img;
        int position;

        public MeizhiViewHolder(View itemView) {
            super(itemView);
            img = (ImageView) itemView.findViewById(R.id.item_photo);
            img.setOnClickListener(new View.OnClickListener() {
                @Override public void onClick(View v) {
                    RxBus.getInstance()
// Path: app/src/main/java/me/wavever/ganklock/event/ClickEvent.java
// public class ClickEvent {
// 
//     public static final int CLICK_TYPE_DAILY_PHOTO = 0;
//     public static final int CLICK_TYPE_DAILY_TITLE = 1;
// 
//     public static final int CLICK_TYPE_MEIZHI = 2;
// 
//     public static final int CLICK_TYPE_LIKE = 3;
// 
//     public int eventType;
// 
//     public GankDaily gankDaily;
// 
//     public int position;
// 
//     public ClickEvent(int eventType,GankDaily gankDaily) {
//         this.eventType = eventType;
//         this.gankDaily = gankDaily;
//     }
// 
//     public ClickEvent(int eventType,int position) {
//         this.eventType = eventType;
//         this.position = position;
//     }
// 
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/event/RxBus.java
// public class RxBus {
// 
//     private static volatile RxBus instance;
// 
//     private final SerializedSubject<Object, Object> subject;
// 
//     private RxBus() {
//         subject = new SerializedSubject<>(PublishSubject.create());
//     }
// 
//     /**
//      * 单例模式获取RxBus
//      *
//      * @return
//      */
//     public static RxBus getInstance() {
//         RxBus rxBus = instance;
//         if (instance == null) {
//             synchronized (RxBus.class) {
//                 rxBus = instance;
//                 if (instance == null) {
//                     rxBus = new RxBus();
//                     instance = rxBus;
//                 }
//             }
//         }
//         return rxBus;
//     }
// 
//     /**
//      * 发送一个新的事件
//      *
//      * @param object
//      */
//     public void post(Object object) {
//         subject.onNext(object);
//     }
// 
//     /**
//      * 根据传递的eventType类型返回特定的被观察者
//      * @param eventType
//      * @param <T>
//      * @return
//      */
//     public <T> Observable<T> tObservable(Class<T> eventType) {
//         return subject.ofType(eventType);
//     }
// 
//     public boolean hasObservers() {
//         return subject.hasObservers();
//     }
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/ui/adapter/MeizhiRecyclerViewAdapter.java
// class MeizhiViewHolder extends ViewHolder {
// 
//     ImageView img;
//     int position;
// 
//     public MeizhiViewHolder(View itemView) {
//         super(itemView);
//         img = (ImageView) itemView.findViewById(R.id.item_photo);
//         img.setOnClickListener(new View.OnClickListener() {
//             @Override public void onClick(View v) {
//                 RxBus.getInstance()
//                     .post(new ClickEvent(ClickEvent.CLICK_TYPE_MEIZHI, position));
//             }
//         });
//     }
// }


// Path: app/src/main/java/me/wavever/ganklock/ui/adapter/MeizhiRecyclerViewAdapter.java
import android.content.Context;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.util.List;
import me.wavever.ganklock.R;
import me.wavever.ganklock.event.ClickEvent;
import me.wavever.ganklock.event.RxBus;
import me.wavever.ganklock.ui.adapter.MeizhiRecyclerViewAdapter.MeizhiViewHolder;

    @Override
    public MeizhiViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.item_meizhi_recycler_view, parent, false);
        return new MeizhiViewHolder(view);
    }

    @Override
    public void onBindViewHolder(MeizhiViewHolder holder, int position) {
        holder.position = position;
        Picasso.with(mContext).load(mList.get(position)).resize(300,300).centerCrop().into(holder.img);
    }


    @Override public int getItemCount() {
        return mList == null ? 0 : mList.size();
    }


    class MeizhiViewHolder extends ViewHolder {

        ImageView img;
        int position;

        public MeizhiViewHolder(View itemView) {
            super(itemView);
            img = (ImageView) itemView.findViewById(R.id.item_photo);
            img.setOnClickListener(new View.OnClickListener() {
                @Override public void onClick(View v) {
                    RxBus.getInstance()
                        .post(new ClickEvent(ClickEvent.CLICK_TYPE_MEIZHI, position));