// Path: app/src/main/java/app/com/cn/album/dao/Photo.java
// public class Photo {
// 
//     public String sMediumUrl;
//     public String sThumbnailUrl;
//     public String sLargeSize;
//     public String sLargeUrl;
//     public String ids;
//     public String sFolderName;
//     public Photo(String ids, String sFolderName, String sMediumUrl, String sThumbnailUrl, String sLargeSize, String sLargeUrl){
//         this.ids = ids;
//         this.sFolderName = sFolderName;
//         this.sMediumUrl = sMediumUrl;
//         this.sThumbnailUrl = sThumbnailUrl;
//         this.sLargeSize = sLargeSize;
//         this.sLargeUrl = sLargeUrl;
//     }
// 
//     public String getLargeUrl() {
//         return sLargeUrl;
//     }
// 
//     public void setLargeUrl(String sLargeUrl) {
//         this.sLargeUrl = sLargeUrl;
//     }
// 
//     public String getMediumUrl() {
//         return sMediumUrl;
//     }
// 
//     public void setMediumUrl(String sMediumUrl) {
//         this.sMediumUrl = sMediumUrl;
//     }
// 
//     public String getThumbnailUrl() {
//         return sThumbnailUrl;
//     }
// 
//     public void setThumbnailUrl(String sThumbnailUrl) {
//         this.sThumbnailUrl = sThumbnailUrl;
//     }
// 
//     public String getLargeSize() {
//         return sLargeSize;
//     }
// 
//     public void setLargeSize(String sLargeSize) {
//         this.sLargeSize = sLargeSize;
//     }
// }


import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.animation.ViewPropertyAnimation;
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
import com.bumptech.glide.request.target.SizeReadyCallback;
import app.com.cn.album.dao.Photo;
package app.com.cn.album.net;




public class GlideHelper {

    private static final ViewPropertyAnimation.Animator ANIMATOR =
            new ViewPropertyAnimation.Animator() {
                @Override
                public void animate(View view) {
                    view.setAlpha(0f);
                    view.animate().alpha(1f);
                }
            };


    public static void loadResource(@DrawableRes int drawableId, @NonNull ImageView image) {
        DisplayMetrics metrics = image.getResources().getDisplayMetrics();
        final int w = metrics.widthPixels, h = metrics.heightPixels;

        Glide.with(image.getContext())
                .load(drawableId)
                .animate(ANIMATOR)
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .into(new GlideDrawableImageViewTarget(image) {
                    @Override
                    public void getSize(final SizeReadyCallback cb) {
                        // We don't want to load very big images on devices with small screens.
                        // This will help Glide correctly choose images scale when reading them.
                        super.getSize(new SizeReadyCallback() {
                            @Override
                            public void onSizeReady(int width, int height) {
                                cb.onSizeReady(w / 2, h / 2);
                            }
                        });
                    }
                });
    }

// Path: app/src/main/java/app/com/cn/album/dao/Photo.java
// public class Photo {
// 
//     public String sMediumUrl;
//     public String sThumbnailUrl;
//     public String sLargeSize;
//     public String sLargeUrl;
//     public String ids;
//     public String sFolderName;
//     public Photo(String ids, String sFolderName, String sMediumUrl, String sThumbnailUrl, String sLargeSize, String sLargeUrl){
//         this.ids = ids;
//         this.sFolderName = sFolderName;
//         this.sMediumUrl = sMediumUrl;
//         this.sThumbnailUrl = sThumbnailUrl;
//         this.sLargeSize = sLargeSize;
//         this.sLargeUrl = sLargeUrl;
//     }
// 
//     public String getLargeUrl() {
//         return sLargeUrl;
//     }
// 
//     public void setLargeUrl(String sLargeUrl) {
//         this.sLargeUrl = sLargeUrl;
//     }
// 
//     public String getMediumUrl() {
//         return sMediumUrl;
//     }
// 
//     public void setMediumUrl(String sMediumUrl) {
//         this.sMediumUrl = sMediumUrl;
//     }
// 
//     public String getThumbnailUrl() {
//         return sThumbnailUrl;
//     }
// 
//     public void setThumbnailUrl(String sThumbnailUrl) {
//         this.sThumbnailUrl = sThumbnailUrl;
//     }
// 
//     public String getLargeSize() {
//         return sLargeSize;
//     }
// 
//     public void setLargeSize(String sLargeSize) {
//         this.sLargeSize = sLargeSize;
//     }
// }


// Path: app/src/main/java/app/com/cn/album/net/GlideHelper.java
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.animation.ViewPropertyAnimation;
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
import com.bumptech.glide.request.target.SizeReadyCallback;
import app.com.cn.album.dao.Photo;

package app.com.cn.album.net;




public class GlideHelper {

    private static final ViewPropertyAnimation.Animator ANIMATOR =
            new ViewPropertyAnimation.Animator() {
                @Override
                public void animate(View view) {
                    view.setAlpha(0f);
                    view.animate().alpha(1f);
                }
            };


    public static void loadResource(@DrawableRes int drawableId, @NonNull ImageView image) {
        DisplayMetrics metrics = image.getResources().getDisplayMetrics();
        final int w = metrics.widthPixels, h = metrics.heightPixels;

        Glide.with(image.getContext())
                .load(drawableId)
                .animate(ANIMATOR)
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .into(new GlideDrawableImageViewTarget(image) {
                    @Override
                    public void getSize(final SizeReadyCallback cb) {
                        // We don't want to load very big images on devices with small screens.
                        // This will help Glide correctly choose images scale when reading them.
                        super.getSize(new SizeReadyCallback() {
                            @Override
                            public void onSizeReady(int width, int height) {
                                cb.onSizeReady(w / 2, h / 2);
                            }
                        });
                    }
                });
    }

    public static void loadFlickrThumb(@Nullable Photo photo, @NonNull final ImageView image) {