// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/commen/AnimateFirstDisplayListener.java
// public class AnimateFirstDisplayListener extends SimpleImageLoadingListener {
// 
//     private final List<String> displayedImages = Collections
//             .synchronizedList(new LinkedList<String>());
// 
//     @Override
//     public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
//         if (loadedImage != null) {
//             ImageView imageView = (ImageView) view;
//             boolean firstDisplay = !displayedImages.contains(imageUri);
//             if (firstDisplay) {
//                 FadeInBitmapDisplayer.animate(imageView, 500);
//                 displayedImages.add(imageUri);
//             }
//         }
//     }
// }
// 
// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/customviews/SquareImageView.java
// public class SquareImageView extends ImageView {
//     public SquareImageView(Context context) {
//         super(context);
//     }
// 
//     public SquareImageView(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public SquareImageView(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     @Override
//     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//         int widthMode = MeasureSpec.getMode(widthMeasureSpec);
//         int heightMode = MeasureSpec.getMode(heightMeasureSpec);
//         if (widthMode == MeasureSpec.EXACTLY && heightMode != MeasureSpec.EXACTLY) {
//             int width = MeasureSpec.getSize(widthMeasureSpec);
//             int height = width;
//             if (heightMode == MeasureSpec.AT_MOST) {
//                 height = Math.min(height, MeasureSpec.getSize(heightMeasureSpec));
//             }
//             setMeasuredDimension(width, height);
//         } else {
//             super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//         }
//     }
// }


import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.ui.commen.AnimateFirstDisplayListener;
import com.fei_ke.chiphellclient.ui.customviews.SquareImageView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;
import java.util.ArrayList;
import java.util.List;
                .build();
        private List<String> pics = new ArrayList<>();
        private AnimateFirstDisplayListener firstDisplayListener = new AnimateFirstDisplayListener();

        public void update(List<String> pics) {
            this.pics.clear();
            this.pics.addAll(pics);
        }

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

        @Override
        public String getItem(int position) {
            return pics.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ImageView imageView;
            if (convertView != null) {
                imageView = (ImageView) convertView;
            } else {
// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/commen/AnimateFirstDisplayListener.java
// public class AnimateFirstDisplayListener extends SimpleImageLoadingListener {
// 
//     private final List<String> displayedImages = Collections
//             .synchronizedList(new LinkedList<String>());
// 
//     @Override
//     public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
//         if (loadedImage != null) {
//             ImageView imageView = (ImageView) view;
//             boolean firstDisplay = !displayedImages.contains(imageUri);
//             if (firstDisplay) {
//                 FadeInBitmapDisplayer.animate(imageView, 500);
//                 displayedImages.add(imageUri);
//             }
//         }
//     }
// }
// 
// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/customviews/SquareImageView.java
// public class SquareImageView extends ImageView {
//     public SquareImageView(Context context) {
//         super(context);
//     }
// 
//     public SquareImageView(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public SquareImageView(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     @Override
//     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//         int widthMode = MeasureSpec.getMode(widthMeasureSpec);
//         int heightMode = MeasureSpec.getMode(heightMeasureSpec);
//         if (widthMode == MeasureSpec.EXACTLY && heightMode != MeasureSpec.EXACTLY) {
//             int width = MeasureSpec.getSize(widthMeasureSpec);
//             int height = width;
//             if (heightMode == MeasureSpec.AT_MOST) {
//                 height = Math.min(height, MeasureSpec.getSize(heightMeasureSpec));
//             }
//             setMeasuredDimension(width, height);
//         } else {
//             super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//         }
//     }
// }


// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/fragment/GridPicFragment.java
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.ui.commen.AnimateFirstDisplayListener;
import com.fei_ke.chiphellclient.ui.customviews.SquareImageView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;
import java.util.ArrayList;
import java.util.List;

                .build();
        private List<String> pics = new ArrayList<>();
        private AnimateFirstDisplayListener firstDisplayListener = new AnimateFirstDisplayListener();

        public void update(List<String> pics) {
            this.pics.clear();
            this.pics.addAll(pics);
        }

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

        @Override
        public String getItem(int position) {
            return pics.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ImageView imageView;
            if (convertView != null) {
                imageView = (ImageView) convertView;
            } else {
                imageView = new SquareImageView(parent.getContext());