Unverified Commit 731cb2b2 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #1992 from dev-ritik/issue_1887

[IMPROVEMENT] Request confirmation before sending a photo from the camera
parents 31c879b2 95354150
......@@ -72,7 +72,6 @@ import chat.rocket.android.util.extensions.circularRevealOrUnreveal
import chat.rocket.android.util.extensions.clearLightStatusBar
import chat.rocket.android.util.extensions.fadeIn
import chat.rocket.android.util.extensions.fadeOut
import chat.rocket.android.util.extensions.getBitmpap
import chat.rocket.android.util.extensions.hideKeyboard
import chat.rocket.android.util.extensions.inflate
import chat.rocket.android.util.extensions.isNotNullNorEmpty
......@@ -346,10 +345,8 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
if (resultCode == Activity.RESULT_OK) {
when (requestCode) {
REQUEST_CODE_FOR_PERFORM_CAMERA -> takenPhotoUri?.let { uri ->
uri.getBitmpap(requireContext())?.let { bitmap ->
presenter.uploadImage(chatRoomId, "image/png", uri, bitmap, "")
}
REQUEST_CODE_FOR_PERFORM_CAMERA -> takenPhotoUri?.let {
showFileAttachmentDialog(it)
}
REQUEST_CODE_FOR_PERFORM_SAF -> resultData?.data?.let {
showFileAttachmentDialog(it)
......
......@@ -97,4 +97,4 @@ fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) {
cancelButton.setOnClickListener { alertDialog?.dismiss() }
alertDialog?.show()
}
\ No newline at end of file
}
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