mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-16 23:02:23 -08:00
Fixed texts being incorrect if injected from context
This commit is contained in:
committed by
John Wu
parent
d3dffe8165
commit
6977dc082f
@@ -4,6 +4,7 @@ import android.content.res.Resources
|
||||
import android.widget.TextView
|
||||
import androidx.databinding.BindingAdapter
|
||||
import androidx.databinding.InverseBindingAdapter
|
||||
import com.topjohnwu.magisk.extensions.get
|
||||
|
||||
sealed class TransitiveText {
|
||||
|
||||
@@ -47,7 +48,7 @@ fun CharSequence.asTransitive() = TransitiveText.String(this)
|
||||
|
||||
@BindingAdapter("android:text")
|
||||
fun TextView.setText(text: TransitiveText) {
|
||||
this.text = text.getText(resources)
|
||||
this.text = text.getText(get())
|
||||
}
|
||||
|
||||
@InverseBindingAdapter(attribute = "android:text", event = "android:textAttrChanged")
|
||||
|
||||
Reference in New Issue
Block a user