every device is 21+ now
This commit is contained in:
parent
7d92ac365d
commit
dd30951dfb
|
@ -437,7 +437,7 @@ public class FileBackend {
|
|||
return bitmap;
|
||||
}
|
||||
final String mime = attachment.getMime();
|
||||
if ("application/pdf".equals(mime) && Compatibility.runsTwentyOne()) {
|
||||
if ("application/pdf".equals(mime)) {
|
||||
bitmap = cropCenterSquarePdf(attachment.getUri(), size);
|
||||
drawOverlay(
|
||||
bitmap,
|
||||
|
@ -961,7 +961,7 @@ public class FileBackend {
|
|||
}
|
||||
DownloadableFile file = getFile(message);
|
||||
final String mime = file.getMimeType();
|
||||
if ("application/pdf".equals(mime) && Compatibility.runsTwentyOne()) {
|
||||
if ("application/pdf".equals(mime)) {
|
||||
thumbnail = getPdfDocumentPreview(file, size);
|
||||
} else if (mime.startsWith("video/")) {
|
||||
thumbnail = getVideoPreview(file, size);
|
||||
|
@ -1507,12 +1507,12 @@ public class FileBackend {
|
|||
body.append(url);
|
||||
}
|
||||
body.append('|').append(file.getSize());
|
||||
if (image || video || (pdf && Compatibility.runsTwentyOne())) {
|
||||
if (image || video || pdf) {
|
||||
try {
|
||||
final Dimensions dimensions;
|
||||
if (video) {
|
||||
dimensions = getVideoDimensions(file);
|
||||
} else if (pdf && Compatibility.runsTwentyOne()) {
|
||||
} else if (pdf) {
|
||||
dimensions = getPdfDocumentDimensions(file);
|
||||
} else {
|
||||
dimensions = getImageDimensions(file);
|
||||
|
|
|
@ -179,7 +179,7 @@ public class Attachment implements Parcelable {
|
|||
private static boolean renderFileThumbnail(final String mime) {
|
||||
return mime.startsWith("video/")
|
||||
|| isImage(mime)
|
||||
|| (Compatibility.runsTwentyOne() && "application/pdf".equals(mime));
|
||||
|| "application/pdf".equals(mime);
|
||||
}
|
||||
|
||||
public Uri getUri() {
|
||||
|
|
|
@ -43,10 +43,6 @@ public class Compatibility {
|
|||
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ContextCompat.checkSelfPermission(context, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
public static boolean runsTwentyOne() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
|
||||
}
|
||||
|
||||
private static boolean runsTwentyFour() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue