// Path: android-imageselector-lib/src/main/java/com/netease/imageSelector/model/LocalMedia.java
// public class LocalMedia implements Serializable {
//     private String path;
//     private long duration;
//     private long lastUpdateAt;
// 
// 
//     public LocalMedia(String path, long lastUpdateAt, long duration) {
//         this.path = path;
//         this.duration = duration;
//         this.lastUpdateAt = lastUpdateAt;
//     }
// 
//     public LocalMedia(String path) {
//         this.path = path;
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public void setPath(String path) {
//         this.path = path;
//     }
// 
//     public long getLastUpdateAt() {
//         return lastUpdateAt;
//     }
// 
//     public void setLastUpdateAt(long lastUpdateAt) {
//         this.lastUpdateAt = lastUpdateAt;
//     }
// 
//     public long getDuration() {
//         return duration;
//     }
//     public void setDuration(long duration) {
//         this.duration = duration;
//     }
// }
// 
// Path: android-imageselector-lib/src/main/java/com/netease/imageSelector/view/ImagePreviewFragment.java
// public class ImagePreviewFragment extends Fragment {
//     public static final String PATH = "path";
// 
//     public static ImagePreviewFragment getInstance(String path) {
//         ImagePreviewFragment fragment = new ImagePreviewFragment();
//         Bundle bundle = new Bundle();
//         bundle.putString(PATH, path);
//         fragment.setArguments(bundle);
//         return fragment;
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View contentView = inflater.inflate(R.layout.fragment_image_preview, container, false);
//         final ImageView imageView = (ImageView) contentView.findViewById(R.id.preview_image);
//         final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
//         Glide.with(container.getContext())
// //                .load(new File(getArguments().getString(PATH)))
//                 .load(getArguments().getString(PATH))
//                 .asBitmap()
//                 .into(new SimpleTarget<Bitmap>(480, 800) {
//                     @Override
//                     public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
//                         imageView.setImageBitmap(resource);
//                         mAttacher.update();
//                     }
//                 });
//         mAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
//             @Override
//             public void onViewTap(View view, float x, float y) {
//                 ImagePreviewActivity activity = (ImagePreviewActivity) getActivity();
//                 activity.switchBarVisibility();
//             }
//         });
//         return contentView;
//     }
// }


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.util.Log;
import com.netease.imageSelector.model.LocalMedia;
import com.netease.imageSelector.view.ImagePreviewFragment;
import java.util.ArrayList;
package com.netease.imageSelector.adapter;




/**
 * @author hzzhengrui
 * @Date 16/10/17
 * @Description
 */
public class DeletePreviewPagerAdapter extends FragmentStatePagerAdapter {

    private ArrayList<Fragment> mFragmentList;

    public DeletePreviewPagerAdapter(FragmentManager fm, ArrayList<LocalMedia> mDatas) {
        super(fm);
        updateData(mDatas);
    }

    public void updateData(ArrayList<LocalMedia> dataList) {
        ArrayList<Fragment> fragments = new ArrayList<>();
        for (int i = 0, size = dataList.size(); i < size; i++) {
            Log.e("FPagerAdapter1", dataList.get(i).toString());
// Path: android-imageselector-lib/src/main/java/com/netease/imageSelector/model/LocalMedia.java
// public class LocalMedia implements Serializable {
//     private String path;
//     private long duration;
//     private long lastUpdateAt;
// 
// 
//     public LocalMedia(String path, long lastUpdateAt, long duration) {
//         this.path = path;
//         this.duration = duration;
//         this.lastUpdateAt = lastUpdateAt;
//     }
// 
//     public LocalMedia(String path) {
//         this.path = path;
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public void setPath(String path) {
//         this.path = path;
//     }
// 
//     public long getLastUpdateAt() {
//         return lastUpdateAt;
//     }
// 
//     public void setLastUpdateAt(long lastUpdateAt) {
//         this.lastUpdateAt = lastUpdateAt;
//     }
// 
//     public long getDuration() {
//         return duration;
//     }
//     public void setDuration(long duration) {
//         this.duration = duration;
//     }
// }
// 
// Path: android-imageselector-lib/src/main/java/com/netease/imageSelector/view/ImagePreviewFragment.java
// public class ImagePreviewFragment extends Fragment {
//     public static final String PATH = "path";
// 
//     public static ImagePreviewFragment getInstance(String path) {
//         ImagePreviewFragment fragment = new ImagePreviewFragment();
//         Bundle bundle = new Bundle();
//         bundle.putString(PATH, path);
//         fragment.setArguments(bundle);
//         return fragment;
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View contentView = inflater.inflate(R.layout.fragment_image_preview, container, false);
//         final ImageView imageView = (ImageView) contentView.findViewById(R.id.preview_image);
//         final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
//         Glide.with(container.getContext())
// //                .load(new File(getArguments().getString(PATH)))
//                 .load(getArguments().getString(PATH))
//                 .asBitmap()
//                 .into(new SimpleTarget<Bitmap>(480, 800) {
//                     @Override
//                     public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
//                         imageView.setImageBitmap(resource);
//                         mAttacher.update();
//                     }
//                 });
//         mAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
//             @Override
//             public void onViewTap(View view, float x, float y) {
//                 ImagePreviewActivity activity = (ImagePreviewActivity) getActivity();
//                 activity.switchBarVisibility();
//             }
//         });
//         return contentView;
//     }
// }


// Path: android-imageselector-lib/src/main/java/com/netease/imageSelector/adapter/DeletePreviewPagerAdapter.java
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.util.Log;
import com.netease.imageSelector.model.LocalMedia;
import com.netease.imageSelector.view.ImagePreviewFragment;
import java.util.ArrayList;

package com.netease.imageSelector.adapter;




/**
 * @author hzzhengrui
 * @Date 16/10/17
 * @Description
 */
public class DeletePreviewPagerAdapter extends FragmentStatePagerAdapter {

    private ArrayList<Fragment> mFragmentList;

    public DeletePreviewPagerAdapter(FragmentManager fm, ArrayList<LocalMedia> mDatas) {
        super(fm);
        updateData(mDatas);
    }

    public void updateData(ArrayList<LocalMedia> dataList) {
        ArrayList<Fragment> fragments = new ArrayList<>();
        for (int i = 0, size = dataList.size(); i < size; i++) {
            Log.e("FPagerAdapter1", dataList.get(i).toString());
            fragments.add(ImagePreviewFragment.getInstance(dataList.get(i).getPath()));