Load MMS parts lazily, display single image if available

This commit is contained in:
Moez Bhatti
2018-01-08 19:18:27 -05:00
parent 9ae7775052
commit 5c13f9b86e
8 changed files with 141 additions and 13 deletions
+21 -6
View File
@@ -18,11 +18,26 @@
*/
package data.model
import android.net.Uri
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
open class MmsPart : RealmObject() {
@PrimaryKey var id: Long = 0
var messageId: Long = 0
var type: String = ""
var data: String? = null
var text: String? = null
var image: String? = null
fun isImage()
= "image/jpeg" == type
|| "image/bmp" == type
|| "image/gif" == type
|| "image/jpg" == type
|| "image/png" == type
fun isText() = "text/plain" == type
class MmsPart {
var name = ""
var mimeType = ""
var data: ByteArray? = null
var path: Uri? = null
}