mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-24 05:55:39 +03:00
Merge pull request #2881 from nextcloud/bugfix/noid/avoidNpeSetupSwipeToReply
Avoid NPE in setupSwipeToReply
This commit is contained in:
commit
60f0c1e079
1 changed files with 12 additions and 10 deletions
|
@ -415,18 +415,20 @@ class ChatController(args: Bundle) :
|
||||||
participantPermissions.hasChatPermission() &&
|
participantPermissions.hasChatPermission() &&
|
||||||
!isReadOnlyConversation()
|
!isReadOnlyConversation()
|
||||||
) {
|
) {
|
||||||
val messageSwipeController = MessageSwipeCallback(
|
activity?.let {
|
||||||
activity!!,
|
val messageSwipeController = MessageSwipeCallback(
|
||||||
object : MessageSwipeActions {
|
it,
|
||||||
override fun showReplyUI(position: Int) {
|
object : MessageSwipeActions {
|
||||||
val chatMessage = adapter?.items?.get(position)?.item as ChatMessage?
|
override fun showReplyUI(position: Int) {
|
||||||
replyToMessage(chatMessage)
|
val chatMessage = adapter?.items?.get(position)?.item as ChatMessage?
|
||||||
|
replyToMessage(chatMessage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
|
||||||
val itemTouchHelper = ItemTouchHelper(messageSwipeController)
|
val itemTouchHelper = ItemTouchHelper(messageSwipeController)
|
||||||
itemTouchHelper.attachToRecyclerView(binding?.messagesListView)
|
itemTouchHelper.attachToRecyclerView(binding?.messagesListView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue