Skip to content

Commit

Permalink
fix: do not set background color for EventSpan if key_back_color
Browse files Browse the repository at this point in the history
…is not color

`key_back_color` can be a image.  However, `EventSpan` does not support drawing a background image.
Need to write a custom `BackgroundSpan` to support it.

refs #1280
  • Loading branch information
goofyz committed Mar 28, 2024
1 parent 710b3e7 commit 10e24e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/com/osfans/trime/ime/text/Composition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
override fun updateDrawState(ds: TextPaint) {
ds.isUnderlineText = false
ds.color = keyTextColor
ds.bgColor = ColorManager.getColor("key_back_color")!!
ColorManager.getColor("key_back_color")?.let {
ds.bgColor = it
}
}
}

Expand Down

0 comments on commit 10e24e2

Please sign in to comment.