Support pasting of images into input text.
This commit is contained in:
parent
ca508514a7
commit
c08199659b
1 changed files with 18 additions and 3 deletions
|
@ -283,15 +283,30 @@ public class MediaUtil {
|
|||
}
|
||||
|
||||
public static boolean isImageType(String contentType) {
|
||||
return (null != contentType) && contentType.startsWith("image/");
|
||||
if (contentType == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return contentType.startsWith("image/") ||
|
||||
contentType.equals(MediaStore.Images.Media.CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public static boolean isAudioType(String contentType) {
|
||||
return (null != contentType) && contentType.startsWith("audio/");
|
||||
if (contentType == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return contentType.startsWith("audio/") ||
|
||||
contentType.equals(MediaStore.Audio.Media.CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public static boolean isVideoType(String contentType) {
|
||||
return (null != contentType) && contentType.startsWith("video/");
|
||||
if (contentType == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return contentType.startsWith("video/") ||
|
||||
contentType.equals(MediaStore.Video.Media.CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public static boolean isImageOrVideoType(String contentType) {
|
||||
|
|
Loading…
Add table
Reference in a new issue