mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
add destruction check before accessing the binding object
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1ebc2bac24
commit
266a9f73ee
@ -773,24 +773,26 @@ class ChatController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupMentionAutocomplete() {
|
private fun setupMentionAutocomplete() {
|
||||||
val elevation = 6f
|
if (!isDestroyed && !isBeingDestroyed) {
|
||||||
resources?.let {
|
val elevation = 6f
|
||||||
val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default))
|
resources?.let {
|
||||||
val presenter = MentionAutocompletePresenter(activity, roomToken)
|
val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default))
|
||||||
val callback = MentionAutocompleteCallback(
|
val presenter = MentionAutocompletePresenter(activity, roomToken)
|
||||||
activity,
|
val callback = MentionAutocompleteCallback(
|
||||||
conversationUser,
|
activity,
|
||||||
binding?.messageInputView?.inputEditText
|
conversationUser,
|
||||||
)
|
binding?.messageInputView?.inputEditText
|
||||||
|
)
|
||||||
|
|
||||||
if (mentionAutocomplete == null && binding?.messageInputView?.inputEditText != null) {
|
if (mentionAutocomplete == null && binding?.messageInputView?.inputEditText != null) {
|
||||||
mentionAutocomplete = Autocomplete.on<Mention>(binding?.messageInputView?.inputEditText)
|
mentionAutocomplete = Autocomplete.on<Mention>(binding?.messageInputView?.inputEditText)
|
||||||
.with(elevation)
|
.with(elevation)
|
||||||
.with(backgroundDrawable)
|
.with(backgroundDrawable)
|
||||||
.with(MagicCharPolicy('@'))
|
.with(MagicCharPolicy('@'))
|
||||||
.with(presenter)
|
.with(presenter)
|
||||||
.with(callback)
|
.with(callback)
|
||||||
.build()
|
.build()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user