Skip to content

Commit 4127a13

Browse files
committed
Update MetricAffectingSpan's functions
Some MetricAffectingSpan functions have changed after API 28.
1 parent 4b571fc commit 4127a13

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecCodeSpan.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ class AztecCodeSpan(override var attributes: AztecAttributes = AztecAttributes()
3333
this.codeStyle = codeStyle
3434
}
3535

36-
override fun updateDrawState(tp: TextPaint?) {
36+
override fun updateDrawState(tp: TextPaint) {
3737
configureTextPaint(tp)
3838
}
3939

40-
override fun updateMeasureState(tp: TextPaint?) {
40+
override fun updateMeasureState(tp: TextPaint) {
4141
configureTextPaint(tp)
4242
}
4343

44-
private fun configureTextPaint(tp: TextPaint?) {
44+
private fun configureTextPaint(tp: TextPaint) {
4545
val alpha: Int = (codeStyle.codeBackgroundAlpha * 255).toInt()
46-
tp?.typeface = Typeface.MONOSPACE
47-
tp?.bgColor = Color.argb(
46+
tp.typeface = Typeface.MONOSPACE
47+
tp.bgColor = Color.argb(
4848
alpha,
4949
Color.red(codeStyle.codeBackground),
5050
Color.green(codeStyle.codeBackground),
5151
Color.blue(codeStyle.codeBackground))
52-
tp?.color = codeStyle.codeColor
52+
tp.color = codeStyle.codeColor
5353
}
5454
}

0 commit comments

Comments
 (0)