Upgrade to Realm 4.1.1

This commit is contained in:
Moez Bhatti
2017-11-01 15:34:22 -07:00
parent 915887dc6b
commit 359e601378
5 changed files with 6 additions and 8 deletions
+1 -4
View File
@@ -9,10 +9,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.android.tools.build:gradle:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:3.7.0" classpath "io.realm:realm-gradle-plugin:4.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
} }
+2 -2
View File
@@ -53,7 +53,7 @@ dependencies {
kapt "android.arch.lifecycle:compiler:1.0.0-alpha9-1" kapt "android.arch.lifecycle:compiler:1.0.0-alpha9-1"
kapt 'com.github.bumptech.glide:compiler:4.3.0' kapt 'com.github.bumptech.glide:compiler:4.3.0'
kapt "com.google.dagger:dagger-compiler:2.11" kapt "com.google.dagger:dagger-compiler:2.11"
kapt 'io.realm:realm-annotations:3.7.0' kapt 'io.realm:realm-annotations:4.1.1'
kapt 'io.realm:realm-annotations-processor:3.7.0' kapt 'io.realm:realm-annotations-processor:4.1.1'
provided 'javax.annotation:jsr250-api:1.0' provided 'javax.annotation:jsr250-api:1.0'
} }
@@ -81,7 +81,7 @@ class NotificationManager @Inject constructor(
.setStyle(style) .setStyle(style)
if (Build.VERSION.SDK_INT >= 24 && conversation != null) { if (Build.VERSION.SDK_INT >= 24 && conversation != null) {
notification.addAction(getReplyAction(conversation.contacts[0].address, conversation.id)) notification.addAction(getReplyAction(conversation.contacts[0]?.address.orEmpty(), conversation.id))
} }
notificationManager.notify(threadId.toInt(), notification.build()) notificationManager.notify(threadId.toInt(), notification.build())
@@ -29,6 +29,7 @@ class MessageRepository @Inject constructor(
return Realm.getDefaultInstance() return Realm.getDefaultInstance()
.where(Message::class.java) .where(Message::class.java)
.findAllSortedAsync("date", Sort.DESCENDING) .findAllSortedAsync("date", Sort.DESCENDING)
.where()
.distinctAsync("threadId") .distinctAsync("threadId")
} }
@@ -46,7 +46,7 @@ class MessagesViewModel(val threadId: Long) : QkViewModel<MessagesView, Messages
intents += view.sendIntent.subscribe { intents += view.sendIntent.subscribe {
val previousState = state.value!! val previousState = state.value!!
sendMessage.execute(SendMessage.Params(threadId, conversation.contacts[0].address, previousState.draft)) sendMessage.execute(SendMessage.Params(threadId, conversation.contacts[0]?.address.orEmpty(), previousState.draft))
newState { it.copy(draft = "", canSend = false) } newState { it.copy(draft = "", canSend = false) }
} }
} }