Cleanup and move things around

This commit is contained in:
topjohnwu
2022-05-26 22:05:28 -07:00
parent 3bcaf0ed5b
commit 683cfee88b
22 changed files with 83 additions and 181 deletions
@@ -30,6 +30,7 @@ import com.google.android.material.chip.Chip
import com.google.android.material.textfield.TextInputLayout
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.di.ServiceLocator
import com.topjohnwu.magisk.utils.TextHolder
import com.topjohnwu.superuser.internal.UiThreadHandler
import com.topjohnwu.widget.IndeterminateCheckBox
import kotlin.math.roundToInt
@@ -289,3 +290,8 @@ fun TextView.setTextColorAttr(attr: Int) {
context.theme.resolveAttribute(attr, tv, true)
setTextColor(tv.data)
}
@BindingAdapter("android:text")
fun TextView.setText(text: TextHolder) {
this.text = text.getText(context.resources)
}