浏览代码

Fix #707

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 5 年之前
父节点
当前提交
fbbcb92ec8
共有 3 个文件被更改,包括 17 次插入16 次删除
  1. 2 2
      app/build.gradle
  2. 0 1
      app/gplay/release/output.json
  3. 15 13
      app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

+ 2 - 2
app/build.gradle

@@ -39,8 +39,8 @@ android {
         targetSdkVersion 29
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
-        versionCode 125
-        versionName "8.0.0beta3"
+        versionCode 126
+        versionName "8.0.0beta4"
 
         flavorDimensions "default"
         renderscriptTargetApi 19

+ 0 - 1
app/gplay/release/output.json

@@ -1 +0,0 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":116,"versionName":"8.0.0beta1","enabled":true,"outputFile":"app-gplay-release.apk","fullName":"gplayRelease","baseName":"gplay-release"},"path":"app-gplay-release.apk","properties":{}}]

+ 15 - 13
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -558,19 +558,21 @@ class ChatController(args: Bundle) : BaseController(args), MessagesListAdapter
 
     private fun setupMentionAutocomplete() {
         val elevation = 6f
-        val backgroundDrawable = ColorDrawable(resources!!.getColor(R.color.bg_default))
-        val presenter = MentionAutocompletePresenter(applicationContext, roomToken)
-        val callback = MentionAutocompleteCallback(activity,
-                conversationUser, messageInput)
-
-        if (mentionAutocomplete == null && messageInput != null) {
-            mentionAutocomplete = Autocomplete.on<Mention>(messageInput)
-                    .with(elevation)
-                    .with(backgroundDrawable)
-                    .with(MagicCharPolicy('@'))
-                    .with(presenter)
-                    .with(callback)
-                    .build()
+        resources?.let {
+            val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default))
+            val presenter = MentionAutocompletePresenter(applicationContext, roomToken)
+            val callback = MentionAutocompleteCallback(activity,
+                    conversationUser, messageInput)
+
+            if (mentionAutocomplete == null && messageInput != null) {
+                mentionAutocomplete = Autocomplete.on<Mention>(messageInput)
+                        .with(elevation)
+                        .with(backgroundDrawable)
+                        .with(MagicCharPolicy('@'))
+                        .with(presenter)
+                        .with(callback)
+                        .build()
+            }
         }
     }