Simplify mms part ContentType checks

This commit is contained in:
Moez Bhatti
2018-01-14 02:41:12 -05:00
parent dcd8cb69ef
commit 093de1e0be
+4 -3
View File
@@ -18,6 +18,7 @@
*/
package data.model
import com.google.android.mms.ContentType
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
@@ -30,10 +31,10 @@ open class MmsPart : RealmObject() {
var text: String? = null
var image: String? = null
fun isSmil() = "application/smil" == type
fun isSmil() = ContentType.APP_SMIL == type
fun isImage() = listOf("image/jpeg", "image/bmp", "image/gif", "image/jpg", "image/png").contains(type)
fun isImage() = ContentType.isImageType(type)
fun isText() = "text/plain" == type
fun isText() = ContentType.isTextType(type)
}