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
f0e411c4
Unverified
Commit
f0e411c4
authored
Oct 23, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into members-user-status
parents
c32b2e8e
a1255c05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
17 deletions
+33
-17
Dialog.kt
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
+27
-16
MessageParser.kt
...src/main/java/chat/rocket/android/helper/MessageParser.kt
+6
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
View file @
f0e411c4
...
@@ -7,6 +7,7 @@ import androidx.core.view.isVisible
...
@@ -7,6 +7,7 @@ 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.getFileName
import
chat.rocket.android.util.extensions.getFileName
import
chat.rocket.android.util.extensions.getMimeType
import
chat.rocket.android.util.extensions.getMimeType
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.bumptech.glide.request.target.SimpleTarget
import
com.bumptech.glide.request.target.SimpleTarget
import
com.bumptech.glide.request.transition.Transition
import
com.bumptech.glide.request.transition.Transition
...
@@ -21,22 +22,32 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
...
@@ -21,22 +22,32 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
description
.
text
.
clear
()
description
.
text
.
clear
()
when
{
when
{
mimeType
.
startsWith
(
"image"
)
->
{
mimeType
.
startsWith
(
"image"
)
->
{
GlideApp
if
(
mimeType
.
contains
(
"gif"
))
{
.
with
(
context
)
GlideApp
.
asBitmap
()
.
with
(
context
)
.
load
(
uri
)
.
asGif
()
.
override
(
imagePreview
.
width
,
imagePreview
.
height
)
.
load
(
uri
)
.
fitCenter
()
.
override
(
imagePreview
.
width
,
imagePreview
.
height
)
.
into
(
object
:
SimpleTarget
<
Bitmap
>()
{
.
fitCenter
()
override
fun
onResourceReady
(
.
into
(
imagePreview
)
resource
:
Bitmap
,
}
else
{
transition
:
Transition
<
in
Bitmap
>?
GlideApp
)
{
.
with
(
context
)
bitmap
=
resource
.
asBitmap
()
imagePreview
.
setImageBitmap
(
resource
)
.
load
(
uri
)
imagePreview
.
isVisible
=
true
.
override
(
imagePreview
.
width
,
imagePreview
.
height
)
}
.
fitCenter
()
})
.
into
(
object
:
SimpleTarget
<
Bitmap
>()
{
override
fun
onResourceReady
(
resource
:
Bitmap
,
transition
:
Transition
<
in
Bitmap
>?
)
{
bitmap
=
resource
imagePreview
.
setImageBitmap
(
resource
)
}
})
}
imagePreview
.
isVisible
=
true
}
}
mimeType
.
startsWith
(
"video"
)
->
audioVideoAttachment
.
isVisible
=
true
mimeType
.
startsWith
(
"video"
)
->
audioVideoAttachment
.
isVisible
=
true
else
->
{
else
->
{
...
...
app/src/main/java/chat/rocket/android/helper/MessageParser.kt
View file @
f0e411c4
...
@@ -13,7 +13,6 @@ import android.text.style.ReplacementSpan
...
@@ -13,7 +13,6 @@ import android.text.style.ReplacementSpan
import
android.view.View
import
android.view.View
import
androidx.core.content.res.ResourcesCompat
import
androidx.core.content.res.ResourcesCompat
import
androidx.core.util.PatternsCompat
import
androidx.core.util.PatternsCompat
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.ui.StrikethroughDelimiterProcessor
import
chat.rocket.android.chatroom.ui.StrikethroughDelimiterProcessor
import
chat.rocket.android.emoji.EmojiParser
import
chat.rocket.android.emoji.EmojiParser
import
chat.rocket.android.emoji.EmojiRepository
import
chat.rocket.android.emoji.EmojiRepository
...
@@ -32,6 +31,7 @@ import org.commonmark.node.Emphasis
...
@@ -32,6 +31,7 @@ import org.commonmark.node.Emphasis
import
org.commonmark.node.ListItem
import
org.commonmark.node.ListItem
import
org.commonmark.node.Node
import
org.commonmark.node.Node
import
org.commonmark.node.OrderedList
import
org.commonmark.node.OrderedList
import
org.commonmark.node.SoftLineBreak
import
org.commonmark.node.StrongEmphasis
import
org.commonmark.node.StrongEmphasis
import
org.commonmark.parser.Parser
import
org.commonmark.parser.Parser
import
ru.noties.markwon.SpannableBuilder
import
ru.noties.markwon.SpannableBuilder
...
@@ -219,6 +219,11 @@ class MessageParser @Inject constructor(
...
@@ -219,6 +219,11 @@ class MessageParser @Inject constructor(
builder
.
append
(
'\n'
)
builder
.
append
(
'\n'
)
}
}
}
}
override
fun
visit
(
softLineBreak
:
SoftLineBreak
)
{
super
.
visit
(
softLineBreak
)
builder
.
append
(
"\n"
)
}
}
}
class
LinkVisitor
(
private
val
builder
:
SpannableBuilder
)
:
AbstractVisitor
()
{
class
LinkVisitor
(
private
val
builder
:
SpannableBuilder
)
:
AbstractVisitor
()
{
...
...
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