// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/utils/Utils.java
// public class Utils {
// 
//     public static int getDeviceDefaultOrientation(Context context) {
//         WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Configuration config = context.getResources().getConfiguration();
// 
//         int rotation = windowManager.getDefaultDisplay().getRotation();
// 
//         if (((rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) &&
//                 config.orientation == Configuration.ORIENTATION_LANDSCAPE)
//                 || ((rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) &&
//                 config.orientation == Configuration.ORIENTATION_PORTRAIT)) {
//             return Configuration.ORIENTATION_LANDSCAPE;
//         } else {
//             return Configuration.ORIENTATION_PORTRAIT;
//         }
//     }
// 
//     public static String getMimeType(String url) {
//         String type = "";
//         String extension = MimeTypeMap.getFileExtensionFromUrl(url);
//         if (!TextUtils.isEmpty(extension)) {
//             type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
//         } else {
//             String reCheckExtension = MimeTypeMap.getFileExtensionFromUrl(url.replaceAll("\\s+", ""));
//             if (!TextUtils.isEmpty(reCheckExtension)) {
//                 type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(reCheckExtension);
//             }
//         }
//         return type;
//     }
// 
//     public static int convertDipToPixels(Context context, int dip) {
//         Resources resources = context.getResources();
//         float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, resources.getDisplayMetrics());
//         return (int) px;
//     }
// 
//     /**
//      * This method converts dp unit to equivalent pixels, depending on device density.
//      *
//      * @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels
//      * @return A float value to represent px equivalent to dp depending on device density
//      */
//     public static int convertDpToPixel(int dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
// 
// 
// }


import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.IntDef;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import com.sandrios.sandriosCamera.R;
import com.sandrios.sandriosCamera.internal.utils.Utils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
package com.sandrios.sandriosCamera.internal.ui.view;





/**
 * Created by Arpit Gandhi on 6/24/16.
 */
public class CameraSwitchView extends AppCompatImageButton {

    public static final int CAMERA_TYPE_FRONT = 0;
    public static final int CAMERA_TYPE_REAR = 1;
    private OnCameraTypeChangeListener onCameraTypeChangeListener;
    private Context context;
    private Drawable frontCameraDrawable;
    private Drawable rearCameraDrawable;
    private int padding = 5;
    private
    @CameraType
    int currentCameraType = CAMERA_TYPE_REAR;

    public CameraSwitchView(Context context) {
        this(context, null);
    }

    public CameraSwitchView(Context context, AttributeSet attrs) {
        super(context, attrs);
// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/utils/Utils.java
// public class Utils {
// 
//     public static int getDeviceDefaultOrientation(Context context) {
//         WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Configuration config = context.getResources().getConfiguration();
// 
//         int rotation = windowManager.getDefaultDisplay().getRotation();
// 
//         if (((rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) &&
//                 config.orientation == Configuration.ORIENTATION_LANDSCAPE)
//                 || ((rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) &&
//                 config.orientation == Configuration.ORIENTATION_PORTRAIT)) {
//             return Configuration.ORIENTATION_LANDSCAPE;
//         } else {
//             return Configuration.ORIENTATION_PORTRAIT;
//         }
//     }
// 
//     public static String getMimeType(String url) {
//         String type = "";
//         String extension = MimeTypeMap.getFileExtensionFromUrl(url);
//         if (!TextUtils.isEmpty(extension)) {
//             type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
//         } else {
//             String reCheckExtension = MimeTypeMap.getFileExtensionFromUrl(url.replaceAll("\\s+", ""));
//             if (!TextUtils.isEmpty(reCheckExtension)) {
//                 type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(reCheckExtension);
//             }
//         }
//         return type;
//     }
// 
//     public static int convertDipToPixels(Context context, int dip) {
//         Resources resources = context.getResources();
//         float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, resources.getDisplayMetrics());
//         return (int) px;
//     }
// 
//     /**
//      * This method converts dp unit to equivalent pixels, depending on device density.
//      *
//      * @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels
//      * @return A float value to represent px equivalent to dp depending on device density
//      */
//     public static int convertDpToPixel(int dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
// 
// 
// }


// Path: sandriosCamera/src/main/java/com/sandrios/sandriosCamera/internal/ui/view/CameraSwitchView.java
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.IntDef;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import com.sandrios.sandriosCamera.R;
import com.sandrios.sandriosCamera.internal.utils.Utils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

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





/**
 * Created by Arpit Gandhi on 6/24/16.
 */
public class CameraSwitchView extends AppCompatImageButton {

    public static final int CAMERA_TYPE_FRONT = 0;
    public static final int CAMERA_TYPE_REAR = 1;
    private OnCameraTypeChangeListener onCameraTypeChangeListener;
    private Context context;
    private Drawable frontCameraDrawable;
    private Drawable rearCameraDrawable;
    private int padding = 5;
    private
    @CameraType
    int currentCameraType = CAMERA_TYPE_REAR;

    public CameraSwitchView(Context context) {
        this(context, null);
    }

    public CameraSwitchView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;