// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/SandriosCamera.java
// public class SandriosCamera {
// 
//     public static int RESULT_CODE = 956;
//     public static String MEDIA = "media";
//     private static SandriosCamera mInstance = null;
//     private int mediaAction = CameraConfiguration.MEDIA_ACTION_BOTH;
//     private boolean showPicker = true;
//     private boolean autoRecord = false;
//     private boolean enableImageCrop = false;
//     private long videoSize = -1;
// 
//     public static SandriosCamera with() {
//         if (mInstance == null) {
//             mInstance = new SandriosCamera();
//         }
//         return mInstance;
//     }
// 
//     public SandriosCamera setShowPicker(boolean showPicker) {
//         this.showPicker = showPicker;
//         return mInstance;
//     }
// 
//     public SandriosCamera setMediaAction(int mediaAction) {
//         this.mediaAction = mediaAction;
//         return mInstance;
//     }
// 
//     public SandriosCamera enableImageCropping(boolean enableImageCrop) {
//         this.enableImageCrop = enableImageCrop;
//         return mInstance;
//     }
// 
//     @SuppressWarnings("SameParameterValue")
//     public SandriosCamera setVideoFileSize(int fileSize) {
//         this.videoSize = fileSize;
//         return mInstance;
//     }
// 
//     /**
//      * Only works if Media Action is set to Video
//      */
//     public SandriosCamera setAutoRecord() {
//         autoRecord = true;
//         return mInstance;
//     }
// 
//     public void launchCamera(Activity activity) {
//         if (CameraHelper.hasCamera(activity)) {
//             Intent cameraIntent;
//             if (CameraHelper.hasCamera2(activity)) {
//                 cameraIntent = new Intent(activity, Camera2Activity.class);
//             } else {
//                 cameraIntent = new Intent(activity, Camera1Activity.class);
//             }
//             cameraIntent.putExtra(CameraConfiguration.Arguments.SHOW_PICKER, showPicker);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.MEDIA_ACTION, mediaAction);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.ENABLE_CROP, enableImageCrop);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.AUTO_RECORD, autoRecord);
// 
//             if (videoSize > 0) {
//                 cameraIntent.putExtra(CameraConfiguration.Arguments.VIDEO_FILE_SIZE, videoSize * 1024 * 1024);
//             }
//             activity.startActivityForResult(cameraIntent, RESULT_CODE);
//         }
//     }
// 
//     public class MediaType {
//         public static final int PHOTO = 0;
//         public static final int VIDEO = 1;
//     }
// }
// 
// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/ui/model/Media.java
// public class Media implements Serializable {
//     private int type;
//     private String path;
// 
//     public Media(int type, String path) {
//         this.type = type;
//         this.path = path;
//     }
// 
//     public Media() {
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public void setPath(String path) {
//         this.path = path;
//     }
// 
//     /**
//      * User media type @link{MediaType}
//      *
//      * @return
//      */
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// }


import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sandrios.sandriosCamera.R;
import com.sandrios.sandriosCamera.internal.SandriosCamera;
import com.sandrios.sandriosCamera.internal.ui.model.Media;
import java.util.List;
package com.sandrios.sandriosCamera.internal.ui.view;





/**
 * Created by Arpit Gandhi
 */
public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.GalleryViewHolder> {

    final static int SMALL = 0;
    final static int LARGE = 1;
    private List<Media> pickerTiles;
    private Context context;
    private int type;

    GalleryAdapter(Context context, int type, List<Media> pickerTiles) {
        this.context = context;
        this.type = type;
        this.pickerTiles = pickerTiles;
    }

    @NonNull
    @Override
    public GalleryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view;
        if (type == SMALL) {
            view = LayoutInflater.from(context).inflate(R.layout.gallery_item_small, parent, false);
        } else {
            view = LayoutInflater.from(context).inflate(R.layout.gallery_item_large, parent, false);
        }
        return new GalleryViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull final GalleryViewHolder holder, @SuppressLint("RecyclerView") final int position) {
// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/SandriosCamera.java
// public class SandriosCamera {
// 
//     public static int RESULT_CODE = 956;
//     public static String MEDIA = "media";
//     private static SandriosCamera mInstance = null;
//     private int mediaAction = CameraConfiguration.MEDIA_ACTION_BOTH;
//     private boolean showPicker = true;
//     private boolean autoRecord = false;
//     private boolean enableImageCrop = false;
//     private long videoSize = -1;
// 
//     public static SandriosCamera with() {
//         if (mInstance == null) {
//             mInstance = new SandriosCamera();
//         }
//         return mInstance;
//     }
// 
//     public SandriosCamera setShowPicker(boolean showPicker) {
//         this.showPicker = showPicker;
//         return mInstance;
//     }
// 
//     public SandriosCamera setMediaAction(int mediaAction) {
//         this.mediaAction = mediaAction;
//         return mInstance;
//     }
// 
//     public SandriosCamera enableImageCropping(boolean enableImageCrop) {
//         this.enableImageCrop = enableImageCrop;
//         return mInstance;
//     }
// 
//     @SuppressWarnings("SameParameterValue")
//     public SandriosCamera setVideoFileSize(int fileSize) {
//         this.videoSize = fileSize;
//         return mInstance;
//     }
// 
//     /**
//      * Only works if Media Action is set to Video
//      */
//     public SandriosCamera setAutoRecord() {
//         autoRecord = true;
//         return mInstance;
//     }
// 
//     public void launchCamera(Activity activity) {
//         if (CameraHelper.hasCamera(activity)) {
//             Intent cameraIntent;
//             if (CameraHelper.hasCamera2(activity)) {
//                 cameraIntent = new Intent(activity, Camera2Activity.class);
//             } else {
//                 cameraIntent = new Intent(activity, Camera1Activity.class);
//             }
//             cameraIntent.putExtra(CameraConfiguration.Arguments.SHOW_PICKER, showPicker);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.MEDIA_ACTION, mediaAction);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.ENABLE_CROP, enableImageCrop);
//             cameraIntent.putExtra(CameraConfiguration.Arguments.AUTO_RECORD, autoRecord);
// 
//             if (videoSize > 0) {
//                 cameraIntent.putExtra(CameraConfiguration.Arguments.VIDEO_FILE_SIZE, videoSize * 1024 * 1024);
//             }
//             activity.startActivityForResult(cameraIntent, RESULT_CODE);
//         }
//     }
// 
//     public class MediaType {
//         public static final int PHOTO = 0;
//         public static final int VIDEO = 1;
//     }
// }
// 
// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/ui/model/Media.java
// public class Media implements Serializable {
//     private int type;
//     private String path;
// 
//     public Media(int type, String path) {
//         this.type = type;
//         this.path = path;
//     }
// 
//     public Media() {
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public void setPath(String path) {
//         this.path = path;
//     }
// 
//     /**
//      * User media type @link{MediaType}
//      *
//      * @return
//      */
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// }


// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/ui/view/GalleryAdapter.java
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sandrios.sandriosCamera.R;
import com.sandrios.sandriosCamera.internal.SandriosCamera;
import com.sandrios.sandriosCamera.internal.ui.model.Media;
import java.util.List;

package com.sandrios.sandriosCamera.internal.ui.view;





/**
 * Created by Arpit Gandhi
 */
public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.GalleryViewHolder> {

    final static int SMALL = 0;
    final static int LARGE = 1;
    private List<Media> pickerTiles;
    private Context context;
    private int type;

    GalleryAdapter(Context context, int type, List<Media> pickerTiles) {
        this.context = context;
        this.type = type;
        this.pickerTiles = pickerTiles;
    }

    @NonNull
    @Override
    public GalleryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view;
        if (type == SMALL) {
            view = LayoutInflater.from(context).inflate(R.layout.gallery_item_small, parent, false);
        } else {
            view = LayoutInflater.from(context).inflate(R.layout.gallery_item_large, parent, false);
        }
        return new GalleryViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull final GalleryViewHolder holder, @SuppressLint("RecyclerView") final int position) {
        Media media = pickerTiles.get(position);