Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
7f3fe75d
Commit
7f3fe75d
authored
Jan 13, 2019
by
dev-ritik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds camera image alertDialog
parent
d18051a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+1
-3
Dialog.kt
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
+42
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
7f3fe75d
...
@@ -342,9 +342,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
...
@@ -342,9 +342,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
if
(
resultCode
==
Activity
.
RESULT_OK
)
{
if
(
resultCode
==
Activity
.
RESULT_OK
)
{
when
(
requestCode
)
{
when
(
requestCode
)
{
REQUEST_CODE_FOR_PERFORM_CAMERA
->
takenPhotoUri
?.
let
{
uri
->
REQUEST_CODE_FOR_PERFORM_CAMERA
->
takenPhotoUri
?.
let
{
uri
->
uri
.
getBitmpap
(
requireContext
())
?.
let
{
bitmap
->
showCameraImageAttachmentDialog
(
uri
)
presenter
.
uploadImage
(
chatRoomId
,
"image/png"
,
uri
,
bitmap
,
""
)
}
}
}
REQUEST_CODE_FOR_PERFORM_SAF
->
resultData
?.
data
?.
let
{
REQUEST_CODE_FOR_PERFORM_SAF
->
resultData
?.
data
?.
let
{
showFileAttachmentDialog
(
it
)
showFileAttachmentDialog
(
it
)
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
View file @
7f3fe75d
...
@@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable
...
@@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable
import
android.net.Uri
import
android.net.Uri
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
chat.rocket.android.emoji.internal.GlideApp
import
chat.rocket.android.emoji.internal.GlideApp
import
chat.rocket.android.util.extensions.getBitmpap
import
chat.rocket.android.util.extensions.getFileName
import
chat.rocket.android.util.extensions.getFileName
import
chat.rocket.android.util.extensions.getMimeType
import
chat.rocket.android.util.extensions.getMimeType
import
chat.rocket.common.util.ifNull
import
chat.rocket.common.util.ifNull
...
@@ -97,4 +98,44 @@ fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) {
...
@@ -97,4 +98,44 @@ fun ChatRoomFragment.showDrawAttachmentDialog(byteArray: ByteArray) {
cancelButton
.
setOnClickListener
{
alertDialog
.
dismiss
()
}
cancelButton
.
setOnClickListener
{
alertDialog
.
dismiss
()
}
alertDialog
.
show
()
alertDialog
.
show
()
}
}
\ No newline at end of file
fun
ChatRoomFragment
.
showCameraImageAttachmentDialog
(
uri
:
Uri
)
{
imagePreview
.
isVisible
=
false
audioVideoAttachment
.
isVisible
=
false
textFile
.
isVisible
=
false
activity
?.
let
{
context
->
description
.
text
.
clear
()
GlideApp
.
with
(
context
)
.
asBitmap
()
.
load
(
uri
)
.
fitCenter
()
.
into
(
object
:
SimpleTarget
<
Bitmap
>()
{
override
fun
onResourceReady
(
resource
:
Bitmap
,
transition
:
Transition
<
in
Bitmap
>?
)
{
imagePreview
.
setImageBitmap
(
resource
)
}
})
imagePreview
.
isVisible
=
true
}
sendButton
.
setOnClickListener
{
uri
.
getBitmpap
(
requireContext
())
?.
let
{
bitmap
->
presenter
.
uploadImage
(
chatRoomId
,
"image/png"
,
uri
,
bitmap
,
(
citation
?:
""
)
+
description
.
text
.
toString
())
}
alertDialog
.
dismiss
()
}
cancelButton
.
setOnClickListener
{
alertDialog
.
dismiss
()
}
alertDialog
.
show
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment