// Path: app/src/main/java/com/flyou/girls/ui/typeImageList/domain/TypeImageDomain.java
// public class TypeImageDomain implements Parcelable {
//     private int width;
//     private int height;
//     private String url;
//     private String fullSizeUrl;
// 
//     public TypeImageDomain(int width, int height, String url, String fullSizeUrl) {
//         this.width = width;
//         this.height = height;
//         this.url = url;
//         this.fullSizeUrl = fullSizeUrl;
//     }
// 
//     public int getWidth() {
//         return width;
//     }
// 
//     public void setWidth(int width) {
//         this.width = width;
//     }
// 
//     public int getHeight() {
//         return height;
//     }
// 
//     public void setHeight(int height) {
//         this.height = height;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public void setUrl(String url) {
//         this.url = url;
//     }
// 
//     public String getFullSizeUrl() {
//         return fullSizeUrl;
//     }
// 
//     public void setFullSizeUrl(String fullSizeUrl) {
//         this.fullSizeUrl = fullSizeUrl;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(this.width);
//         dest.writeInt(this.height);
//         dest.writeString(this.url);
//         dest.writeString(this.fullSizeUrl);
//     }
// 
//     protected TypeImageDomain(Parcel in) {
//         this.width = in.readInt();
//         this.height = in.readInt();
//         this.url = in.readString();
//         this.fullSizeUrl = in.readString();
//     }
// 
//     public static final Parcelable.Creator<TypeImageDomain> CREATOR = new Parcelable.Creator<TypeImageDomain>() {
//         @Override
//         public TypeImageDomain createFromParcel(Parcel source) {
//             return new TypeImageDomain(source);
//         }
// 
//         @Override
//         public TypeImageDomain[] newArray(int size) {
//             return new TypeImageDomain[size];
//         }
//     };
// }


import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.flyou.girls.R;
import com.flyou.girls.ui.typeImageList.domain.TypeImageDomain;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import uk.co.senab.photoview.PhotoViewAttacher;

        @Override
        public int getCount() {
            return mImageList.size();
        }

        @Override
        public View instantiateItem(ViewGroup container, final int position) {
            View parent = LayoutInflater.from(container.getContext()).inflate(R.layout.activity_image_detial, container, false);
            container.addView(parent);
            View downLoad = parent.findViewById(R.id.download);
            View loading = parent.findViewById(R.id.laoding);
            downLoad.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downloadImage(mImageList.get(position).getFullSizeUrl());
                }
            });
            downLoad.setTag(mImageList.get(position).getFullSizeUrl());
            ImageView imageView = (ImageView) parent.findViewById(R.id.imageView);
            displayImage(mImageList.get(position).getFullSizeUrl(),imageView,loading,downLoad);
            return parent;
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView((View) object);
        }

        @Override
// Path: app/src/main/java/com/flyou/girls/ui/typeImageList/domain/TypeImageDomain.java
// public class TypeImageDomain implements Parcelable {
//     private int width;
//     private int height;
//     private String url;
//     private String fullSizeUrl;
// 
//     public TypeImageDomain(int width, int height, String url, String fullSizeUrl) {
//         this.width = width;
//         this.height = height;
//         this.url = url;
//         this.fullSizeUrl = fullSizeUrl;
//     }
// 
//     public int getWidth() {
//         return width;
//     }
// 
//     public void setWidth(int width) {
//         this.width = width;
//     }
// 
//     public int getHeight() {
//         return height;
//     }
// 
//     public void setHeight(int height) {
//         this.height = height;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public void setUrl(String url) {
//         this.url = url;
//     }
// 
//     public String getFullSizeUrl() {
//         return fullSizeUrl;
//     }
// 
//     public void setFullSizeUrl(String fullSizeUrl) {
//         this.fullSizeUrl = fullSizeUrl;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(this.width);
//         dest.writeInt(this.height);
//         dest.writeString(this.url);
//         dest.writeString(this.fullSizeUrl);
//     }
// 
//     protected TypeImageDomain(Parcel in) {
//         this.width = in.readInt();
//         this.height = in.readInt();
//         this.url = in.readString();
//         this.fullSizeUrl = in.readString();
//     }
// 
//     public static final Parcelable.Creator<TypeImageDomain> CREATOR = new Parcelable.Creator<TypeImageDomain>() {
//         @Override
//         public TypeImageDomain createFromParcel(Parcel source) {
//             return new TypeImageDomain(source);
//         }
// 
//         @Override
//         public TypeImageDomain[] newArray(int size) {
//             return new TypeImageDomain[size];
//         }
//     };
// }


// Path: app/src/main/java/com/flyou/girls/ui/ImageViewPagerActivity.java
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.flyou.girls.R;
import com.flyou.girls.ui.typeImageList.domain.TypeImageDomain;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import uk.co.senab.photoview.PhotoViewAttacher;


        @Override
        public int getCount() {
            return mImageList.size();
        }

        @Override
        public View instantiateItem(ViewGroup container, final int position) {
            View parent = LayoutInflater.from(container.getContext()).inflate(R.layout.activity_image_detial, container, false);
            container.addView(parent);
            View downLoad = parent.findViewById(R.id.download);
            View loading = parent.findViewById(R.id.laoding);
            downLoad.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downloadImage(mImageList.get(position).getFullSizeUrl());
                }
            });
            downLoad.setTag(mImageList.get(position).getFullSizeUrl());
            ImageView imageView = (ImageView) parent.findViewById(R.id.imageView);
            displayImage(mImageList.get(position).getFullSizeUrl(),imageView,loading,downLoad);
            return parent;
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView((View) object);
        }

        @Override
        public boolean isViewFromObject(View view, Object object) {