Commit 47106322 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Fix project compilation.

parent 064485e3
...@@ -9,6 +9,7 @@ import chat.rocket.android.util.extensions.getMimeType ...@@ -9,6 +9,7 @@ import chat.rocket.android.util.extensions.getMimeType
fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) { fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
activity?.let { fragmentActivity -> activity?.let { fragmentActivity ->
uri.getMimeType(fragmentActivity).let { mimeType -> uri.getMimeType(fragmentActivity).let { mimeType ->
description.text.clear()
when { when {
mimeType.startsWith("image") -> { mimeType.startsWith("image") -> {
imagePreview.isVisible = true imagePreview.isVisible = true
...@@ -27,16 +28,14 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) { ...@@ -27,16 +28,14 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
sendButton.setOnClickListener { sendButton.setOnClickListener {
presenter.uploadFile(chatRoomId, uri, (citation ?: "") + description.text.toString()) presenter.uploadFile(chatRoomId, uri, (citation ?: "") + description.text.toString())
clearMessageComposition()
alertDialog.dismiss() alertDialog.dismiss()
} }
cancelButton.setOnClickListener { alertDialog.dismiss() } cancelButton.setOnClickListener { alertDialog.dismiss() }
alertDialog.show() alertDialog.show()
} }
fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) { fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) {
description.text.clear()
imagePreview.isVisible = true imagePreview.isVisible = true
imagePreview.setImageDrawable(Drawable.createFromStream(byteArray.inputStream(), "")) imagePreview.setImageDrawable(Drawable.createFromStream(byteArray.inputStream(), ""))
...@@ -46,11 +45,9 @@ fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) { ...@@ -46,11 +45,9 @@ fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) {
byteArray, byteArray,
(citation ?: "") + description.text.toString() (citation ?: "") + description.text.toString()
) )
clearMessageComposition()
alertDialog.dismiss() alertDialog.dismiss()
} }
cancelButton.setOnClickListener { alertDialog.dismiss() } cancelButton.setOnClickListener { alertDialog.dismiss() }
alertDialog.show() alertDialog.show()
} }
\ No newline at end of file
...@@ -547,8 +547,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -547,8 +547,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
ui { ui {
citation = null citation = null
editingMessageId = null editingMessageId = null
if (deleteMessage) if (deleteMessage) {
text_message.textContent = "" text_message.textContent = ""
}
actionSnackbar.dismiss() actionSnackbar.dismiss()
} }
} }
......
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