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
e1110ec4
Commit
e1110ec4
authored
Feb 07, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn drawable property immutable on QuoteMarginSpan
parent
1e80d270
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
MessageParser.kt
...src/main/java/chat/rocket/android/helper/MessageParser.kt
+4
-4
No files found.
app/src/main/java/chat/rocket/android/helper/MessageParser.kt
View file @
e1110ec4
...
...
@@ -127,7 +127,7 @@ class MessageParser @Inject constructor(val context: Application, private val co
}
class
QuoteMarginSpan
(
quoteDrawable
:
Drawable
,
private
var
pad
:
Int
)
:
LeadingMarginSpan
,
LineHeightSpan
{
private
va
r
drawable
:
Drawable
=
quoteDrawable
private
va
l
drawable
:
Drawable
=
quoteDrawable
override
fun
getLeadingMargin
(
first
:
Boolean
):
Int
{
return
drawable
.
intrinsicWidth
+
pad
...
...
@@ -148,14 +148,14 @@ class MessageParser @Inject constructor(val context: Application, private val co
}
override
fun
chooseHeight
(
text
:
CharSequence
,
start
:
Int
,
end
:
Int
,
i
startv
:
Int
,
v
:
Int
,
span
startv
:
Int
,
v
:
Int
,
fm
:
Paint
.
FontMetricsInt
)
{
if
(
end
==
(
text
as
Spanned
).
getSpanEnd
(
this
))
{
val
ht
=
drawable
.
intrinsicHeight
var
need
=
ht
-
(
v
+
fm
.
descent
-
fm
.
ascent
-
i
startv
)
var
need
=
ht
-
(
v
+
fm
.
descent
-
fm
.
ascent
-
span
startv
)
if
(
need
>
0
)
fm
.
descent
+=
need
need
=
ht
-
(
v
+
fm
.
bottom
-
fm
.
top
-
i
startv
)
need
=
ht
-
(
v
+
fm
.
bottom
-
fm
.
top
-
span
startv
)
if
(
need
>
0
)
fm
.
bottom
+=
need
}
...
...
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