// Path: imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/Drawables.java
// public class Drawables {
//     public static Drawable sPlaceholderDrawable;
//     public static Drawable sErrorDrawable;
// 
//     private Drawables() {
//     }
// 
//     public static void init(final Resources resources) {
//         if (sPlaceholderDrawable == null) {
//             sPlaceholderDrawable = resources.getDrawable(R.drawable.placeholder, null);
//         }
//         if (sErrorDrawable == null) {
//             sErrorDrawable = resources.getDrawable(R.drawable.error, null);
//         }
//     }
// }
// 
// Path: imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/WatchListener.java
// public class WatchListener {
//     private long mRequestTotalTime;
//     private long mStartRequests;
//     private long mSuccessedRequests;
//     private long mFailedRequests;
//     private long mCancelledRequests;
// 
//     public void reportSuccess(long requestTime) {
//         mRequestTotalTime += requestTime;
//         mSuccessedRequests++;
//     }
// 
//     public void initData() {
//         mRequestTotalTime = 0;
//         mStartRequests = 0;
//         mSuccessedRequests = 0;
//         mFailedRequests = 0;
//         mCancelledRequests = 0;
//     }
// 
//     public void reportStart() {
//         mStartRequests++;
//     }
// 
//     public void reportCancelltion(long requestTime) {
//         mCancelledRequests++;
//         mRequestTotalTime += requestTime;
//     }
// 
//     public void reportFailure(long requestTime) {
//         mFailedRequests++;
//         mRequestTotalTime += requestTime;
//     }
// 
// 
//     public long getAverageRequestTime() {
//         final long completedRequests = getCompletedRequests();
//         return completedRequests > 0 ? mRequestTotalTime / completedRequests : 0;
//     }
// 
//     public long getCancelledRequests() {
//         return mCancelledRequests;
//     }
// 
//     public long getCompletedRequests() {
//         return mSuccessedRequests + mCancelledRequests + mFailedRequests;
//     }
// 
//     public long getTotalRequests() {
//         return mStartRequests;
//     }
// }


import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.example.imageloadpk.adapter.watcher.Drawables;
import com.example.imageloadpk.adapter.watcher.WatchListener;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
package com.example.imageloadpk.adapter.holders;



/**
 * Created by Administrator on 2016/7/4.
 */
public class ImageLoaderHolder extends BaseHolder {

    private final ImageLoader mImageLoader;
    DisplayImageOptions mImageOptions;

    public ImageLoaderHolder(ImageView imageView, WatchListener watchListener, View parentView, Context context, ImageLoader imageLoader) {
        super(imageView, watchListener, parentView, context);
        mImageLoader = imageLoader;

        if (mImageOptions == null) {
            mImageOptions = new DisplayImageOptions.Builder()
// Path: imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/Drawables.java
// public class Drawables {
//     public static Drawable sPlaceholderDrawable;
//     public static Drawable sErrorDrawable;
// 
//     private Drawables() {
//     }
// 
//     public static void init(final Resources resources) {
//         if (sPlaceholderDrawable == null) {
//             sPlaceholderDrawable = resources.getDrawable(R.drawable.placeholder, null);
//         }
//         if (sErrorDrawable == null) {
//             sErrorDrawable = resources.getDrawable(R.drawable.error, null);
//         }
//     }
// }
// 
// Path: imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/WatchListener.java
// public class WatchListener {
//     private long mRequestTotalTime;
//     private long mStartRequests;
//     private long mSuccessedRequests;
//     private long mFailedRequests;
//     private long mCancelledRequests;
// 
//     public void reportSuccess(long requestTime) {
//         mRequestTotalTime += requestTime;
//         mSuccessedRequests++;
//     }
// 
//     public void initData() {
//         mRequestTotalTime = 0;
//         mStartRequests = 0;
//         mSuccessedRequests = 0;
//         mFailedRequests = 0;
//         mCancelledRequests = 0;
//     }
// 
//     public void reportStart() {
//         mStartRequests++;
//     }
// 
//     public void reportCancelltion(long requestTime) {
//         mCancelledRequests++;
//         mRequestTotalTime += requestTime;
//     }
// 
//     public void reportFailure(long requestTime) {
//         mFailedRequests++;
//         mRequestTotalTime += requestTime;
//     }
// 
// 
//     public long getAverageRequestTime() {
//         final long completedRequests = getCompletedRequests();
//         return completedRequests > 0 ? mRequestTotalTime / completedRequests : 0;
//     }
// 
//     public long getCancelledRequests() {
//         return mCancelledRequests;
//     }
// 
//     public long getCompletedRequests() {
//         return mSuccessedRequests + mCancelledRequests + mFailedRequests;
//     }
// 
//     public long getTotalRequests() {
//         return mStartRequests;
//     }
// }


// Path: imageloadpk/src/main/java/com/example/imageloadpk/adapter/holders/ImageLoaderHolder.java
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.example.imageloadpk.adapter.watcher.Drawables;
import com.example.imageloadpk.adapter.watcher.WatchListener;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;

package com.example.imageloadpk.adapter.holders;



/**
 * Created by Administrator on 2016/7/4.
 */
public class ImageLoaderHolder extends BaseHolder {

    private final ImageLoader mImageLoader;
    DisplayImageOptions mImageOptions;

    public ImageLoaderHolder(ImageView imageView, WatchListener watchListener, View parentView, Context context, ImageLoader imageLoader) {
        super(imageView, watchListener, parentView, context);
        mImageLoader = imageLoader;

        if (mImageOptions == null) {
            mImageOptions = new DisplayImageOptions.Builder()
                    .showImageOnLoading(Drawables.sPlaceholderDrawable)