package com.ypx.imagepicker.bean; import androidx.collection.ArraySet; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Set; /** * MIME Type enumeration to restrict selectable media on the selection activity. Matisse only supports images and * videos. *
* Good example of mime types Android supports:
* https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/MediaFile.java
*/
public enum MimeType {
// ============== images ==============
JPEG("image/jpeg", arraySetOf(
"jpg",
"jpeg"
)),
PNG("image/png", arraySetOf(
"png"
)),
GIF("image/gif", arraySetOf(
"gif"
)),
BMP("image/x-ms-bmp", arraySetOf(
"bmp", "x-ms-bmp"
)),
WEBP("image/webp", arraySetOf(
"webp"
)),
// ============== videos ==============
MPEG("video/mpeg", arraySetOf(
"mpeg",
"mpg"
)),
MP4("video/mp4", arraySetOf(
"mp4"
)),
QUICKTIME("video/quicktime", arraySetOf(
"mov","quicktime"
)),
THREEGPP("video/3gpp", arraySetOf(
"3gp",
"3gpp"
)),
THREEGPP2("video/3gpp2", arraySetOf(
"3g2",
"3gpp2"
)),
MKV("video/x-matroska", arraySetOf(
"mkv","x-matroska"
)),
WEBM("video/webm", arraySetOf(
"webm"
)),
TS("video/mp2ts", arraySetOf(
"ts","mp2ts"
)),
AVI("video/avi", arraySetOf(
"avi"
));
private final String mMimeTypeName;
private final Set