Skip to content
Snippets Groups Projects
Commit bc8915cc authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Trying to fix a message color bug

parent c29d5c06
Branches
Tags
No related merge requests found
......@@ -134,19 +134,19 @@ class IrcFormatSerializer internal constructor(private val context: Context) {
if (text.getSpanFlags(aStyle) and Spanned.SPAN_COMPOSING != 0)
continue
if (aStyle is StyleSpan) {
if (text.getSpanEnd(aStyle) <= i)
continue
when (aStyle) {
is StyleSpan -> {
afterBold = (aStyle.style and Typeface.BOLD != 0)
afterItalic = (aStyle.style and Typeface.ITALIC != 0)
} else if (aStyle is UnderlineSpan) {
afterUnderline = true
} else if (aStyle is StrikethroughSpan) {
afterStrikethrough = true
} else if (aStyle is TypefaceSpan) {
afterMonospace = aStyle.family == "monospace"
} else if (aStyle is ForegroundColorSpan) {
afterForeground = aStyle.foregroundColor
} else if (aStyle is BackgroundColorSpan) {
afterBackground = aStyle.backgroundColor
}
is UnderlineSpan -> afterUnderline = true
is StrikethroughSpan -> afterStrikethrough = true
is TypefaceSpan -> afterMonospace = aStyle.family == "monospace"
is ForegroundColorSpan -> afterForeground = aStyle.foregroundColor
is BackgroundColorSpan -> afterBackground = aStyle.backgroundColor
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment