mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Load MMS parts lazily, display single image if available
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user