mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 13:08:56 +01:00
Remove some dead code
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
package eu.kanade.tachiyomi.widget
|
||||
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.text.style.ReplacementSpan
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.annotation.Dimension
|
||||
|
||||
/**
|
||||
* Source: https://github.com/santaevpavel
|
||||
*
|
||||
* 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,
|
||||
) : ReplacementSpan() {
|
||||
|
||||
override fun getSize(
|
||||
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,
|
||||
) {
|
||||
val originTextColor = paint.color
|
||||
|
||||
paint.apply {
|
||||
color = strokeColor
|
||||
style = Paint.Style.STROKE
|
||||
this.strokeWidth = this@OutlineSpan.strokeWidth
|
||||
}
|
||||
canvas.drawText(text, start, end, x, y.toFloat(), paint)
|
||||
|
||||
paint.apply {
|
||||
color = originTextColor
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
|
||||
canvas.drawText(text, start, end, x, y.toFloat(), paint)
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package eu.kanade.tachiyomi.widget
|
||||
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
import tachiyomi.domain.manga.model.TriStateFilter
|
||||
|
||||
fun Int.toTriStateFilter(): TriStateFilter {
|
||||
return when (this) {
|
||||
Filter.TriState.STATE_IGNORE -> TriStateFilter.DISABLED
|
||||
Filter.TriState.STATE_INCLUDE -> TriStateFilter.ENABLED_IS
|
||||
Filter.TriState.STATE_EXCLUDE -> TriStateFilter.ENABLED_NOT
|
||||
else -> throw IllegalStateException("Unknown TriState state: $this")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user