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