Commit 42a06734 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Restore UI state when message actions selector pops up

parent f4dc6a53
......@@ -302,6 +302,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
}
}
fun dispatchRestoreUIState() {
view.restoreUIState()
}
private suspend fun listenMessages(roomId: String) {
launch(CommonPool + strategy.jobs) {
for (message in client.messagesChannel) {
......
......@@ -97,4 +97,9 @@ interface ChatRoomView : LoadingView, MessageView {
fun clearMessageComposition()
fun showInvalidFileSize(fileSize: Int, maxFileSize: Int)
/**
* Restore UI state.
*/
fun restoreUIState()
}
\ No newline at end of file
......@@ -96,9 +96,8 @@ class ChatRoomAdapter(private val roomType: String,
setChecked(isPinned)
}
val adapter = ActionListAdapter(menuItems, this@ViewHolder)
BottomSheetMenu(adapter).apply {
}.show(it.context)
presenter.dispatchRestoreUIState()
BottomSheetMenu(adapter).show(it.context)
}
}
}
......
......@@ -214,6 +214,10 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi
adapter.removeItem(msgId)
}
override fun restoreUIState() {
hideAllKeyboards()
}
override fun showReplyingAction(username: String, replyMarkdown: String, quotedMessage: String) {
activity?.apply {
citation = replyMarkdown
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment