forked from upstream-mirrors/quik
correctly bind actionbar in messagelist activity
This commit is contained in:
@@ -40,4 +40,16 @@ open class Conversation() : RealmObject() {
|
||||
error = cursor.getInt(ConversationColumns.ERROR)
|
||||
hasAttachment = cursor.getInt(ConversationColumns.HAS_ATTACHMENT)
|
||||
}
|
||||
|
||||
fun getTitle(): String {
|
||||
var title = ""
|
||||
contacts.forEachIndexed { index, recipient ->
|
||||
title += recipient.address
|
||||
if (index < contacts.size - 1) {
|
||||
title += ", "
|
||||
}
|
||||
}
|
||||
|
||||
return title
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,13 @@ import io.realm.RealmResults
|
||||
|
||||
class ConversationRepository {
|
||||
|
||||
fun getConversation(threadId: Long): RealmResults<Conversation> {
|
||||
return Realm.getDefaultInstance()
|
||||
.where(Conversation::class.java)
|
||||
.equalTo("id", threadId)
|
||||
.findAllAsync()
|
||||
}
|
||||
|
||||
fun getConversations(): RealmResults<Conversation> {
|
||||
return Realm.getDefaultInstance().where(Conversation::class.java).findAllAsync()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user