#1012 - Show video attachments

This commit is contained in:
Moez Bhatti
2018-04-20 16:51:02 -04:00
parent 510a9d23b5
commit dcbae53112
17 changed files with 163 additions and 35 deletions
+1 -3
View File
@@ -18,7 +18,6 @@
*/
package interactor
import androidx.net.toUri
import io.reactivex.Flowable
import repository.ImageRepository
import repository.MessageRepository
@@ -32,8 +31,7 @@ class SaveImage @Inject constructor(
override fun buildObservable(params: Long): Flowable<*> {
return Flowable.just(params)
.map { partId -> messageRepo.getPart(partId) }
.map { part -> part.image }
.map { uriString -> uriString.toUri() }
.map { part -> part.getUri() }
.doOnNext { uri -> imageRepository.saveImage(uri) }
}
+3 -2
View File
@@ -18,6 +18,7 @@
*/
package model
import androidx.net.toUri
import io.realm.RealmObject
import io.realm.RealmResults
import io.realm.annotations.LinkingObjects
@@ -27,11 +28,11 @@ open class MmsPart : RealmObject() {
@PrimaryKey var id: Long = 0
var type: String = ""
var text: String? = null
var image: String? = null
@LinkingObjects("parts")
val messages: RealmResults<Message>? = null
fun getUri() = "content://mms/part/$id".toUri()
}