Commit 6977dc08 authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

Fixed texts being incorrect if injected from context

parent d3dffe81
......@@ -8,6 +8,7 @@ import android.os.Build
import android.os.Bundle
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.preference.PreferenceManager
import com.topjohnwu.magisk.core.ResourceMgr
import com.topjohnwu.magisk.utils.RxBus
import org.koin.core.qualifier.named
import org.koin.dsl.module
......@@ -17,7 +18,7 @@ val Protected = named("protected")
val applicationModule = module {
single { RxBus() }
factory { get<Context>().resources }
factory { ResourceMgr.resource }
factory { get<Context>().packageManager }
factory(Protected) { createDEContext(get()) }
single(SUTimeout) { get<Context>(Protected).getSharedPreferences("su_timeout", 0) }
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment