Run linter
This commit is contained in:
@@ -12,30 +12,30 @@ import androidx.annotation.Dimension
|
||||
* A class that draws the outlines of a text when given a stroke color and stroke width.
|
||||
*/
|
||||
class OutlineSpan(
|
||||
@ColorInt private val strokeColor: Int,
|
||||
@Dimension private val strokeWidth: Float
|
||||
@ColorInt private val strokeColor: Int,
|
||||
@Dimension private val strokeWidth: Float
|
||||
) : ReplacementSpan() {
|
||||
|
||||
override fun getSize(
|
||||
paint: Paint,
|
||||
text: CharSequence,
|
||||
start: Int,
|
||||
end: Int,
|
||||
fm: Paint.FontMetricsInt?
|
||||
paint: Paint,
|
||||
text: CharSequence,
|
||||
start: Int,
|
||||
end: Int,
|
||||
fm: Paint.FontMetricsInt?
|
||||
): Int {
|
||||
return paint.measureText(text.toString().substring(start until end)).toInt()
|
||||
}
|
||||
|
||||
override fun draw(
|
||||
canvas: Canvas,
|
||||
text: CharSequence,
|
||||
start: Int,
|
||||
end: Int,
|
||||
x: Float,
|
||||
top: Int,
|
||||
y: Int,
|
||||
bottom: Int,
|
||||
paint: Paint
|
||||
canvas: Canvas,
|
||||
text: CharSequence,
|
||||
start: Int,
|
||||
end: Int,
|
||||
x: Float,
|
||||
top: Int,
|
||||
y: Int,
|
||||
bottom: Int,
|
||||
paint: Paint
|
||||
) {
|
||||
val originTextColor = paint.color
|
||||
|
||||
@@ -53,5 +53,4 @@ class OutlineSpan(
|
||||
|
||||
canvas.drawText(text, start, end, x, y.toFloat(), paint)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user