Added embedded audio player

This commit is contained in:
M66B
2024-01-23 09:00:06 +01:00
parent 0474a73b4a
commit 1089513888
10 changed files with 168 additions and 12 deletions

View File

@@ -23,6 +23,7 @@ import static androidx.room.ForeignKey.CASCADE;
import android.content.Context;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.net.Uri;
import android.text.TextUtils;
@@ -101,6 +102,9 @@ public class EntityAttachment {
@Ignore
public boolean selected = false;
@Ignore
public MediaPlayer player = null;
// Gmail sends inline images as attachments with a name and cid
boolean isInline() {
@@ -116,6 +120,11 @@ public class EntityAttachment {
return ImageHelper.isImage(getMimeType());
}
boolean isAudio() {
String type = getMimeType();
return (type != null && type.startsWith("audio/"));
}
boolean isPDF() {
return "application/pdf".equals(getMimeType());
}