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
No related branches found
No related tags found
No related merge requests found
...@@ -134,19 +134,19 @@ class IrcFormatSerializer internal constructor(private val context: Context) { ...@@ -134,19 +134,19 @@ class IrcFormatSerializer internal constructor(private val context: Context) {
if (text.getSpanFlags(aStyle) and Spanned.SPAN_COMPOSING != 0) if (text.getSpanFlags(aStyle) and Spanned.SPAN_COMPOSING != 0)
continue continue
if (aStyle is StyleSpan) { if (text.getSpanEnd(aStyle) <= i)
continue
when (aStyle) {
is StyleSpan -> {
afterBold = (aStyle.style and Typeface.BOLD != 0) afterBold = (aStyle.style and Typeface.BOLD != 0)
afterItalic = (aStyle.style and Typeface.ITALIC != 0) afterItalic = (aStyle.style and Typeface.ITALIC != 0)
} else if (aStyle is UnderlineSpan) { }
afterUnderline = true is UnderlineSpan -> afterUnderline = true
} else if (aStyle is StrikethroughSpan) { is StrikethroughSpan -> afterStrikethrough = true
afterStrikethrough = true is TypefaceSpan -> afterMonospace = aStyle.family == "monospace"
} else if (aStyle is TypefaceSpan) { is ForegroundColorSpan -> afterForeground = aStyle.foregroundColor
afterMonospace = aStyle.family == "monospace" is BackgroundColorSpan -> afterBackground = aStyle.backgroundColor
} else if (aStyle is ForegroundColorSpan) {
afterForeground = aStyle.foregroundColor
} else if (aStyle 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