mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-10 04:01:13 -06:00
21 lines
575 B
Kotlin
21 lines
575 B
Kotlin
/*
|
|
* Copyright (c) Kuba Szczodrzyński 2019-11-11.
|
|
*/
|
|
package pl.szczodrzynski.edziennik
|
|
|
|
import android.graphics.Paint
|
|
import android.widget.TextView
|
|
import androidx.databinding.BindingAdapter
|
|
|
|
object Binding {
|
|
@JvmStatic
|
|
@BindingAdapter("strikeThrough")
|
|
fun strikeThrough(textView: TextView, strikeThrough: Boolean) {
|
|
if (strikeThrough) {
|
|
textView.paintFlags = textView.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
|
|
} else {
|
|
textView.paintFlags = textView.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv()
|
|
}
|
|
}
|
|
}
|