mirror of
https://github.com/BetterAndroid/PanguText.git
synced 2025-09-01 08:15:21 +08:00
refactor: update KavaRef usage to 1.0.1
This commit is contained in:
@@ -38,9 +38,9 @@ libraries:
|
||||
version: 1.0.2
|
||||
com.highcapable.kavaref:
|
||||
kavaref-core:
|
||||
version: 1.0.0
|
||||
version: 1.0.1
|
||||
kavaref-extension:
|
||||
version: 1.0.0
|
||||
version: 1.0.1
|
||||
androidx.core:
|
||||
core:
|
||||
version: 1.16.0
|
||||
|
@@ -26,7 +26,7 @@ import android.text.TextWatcher
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import com.highcapable.betterandroid.system.extension.tool.SystemVersion
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||
import com.highcapable.pangutext.android.PanguText
|
||||
import com.highcapable.pangutext.android.PanguTextConfig
|
||||
import com.highcapable.pangutext.android.extension.injectRealTimePanguText
|
||||
@@ -45,7 +45,7 @@ class PanguTextWatcher internal constructor(private val base: TextView, private
|
||||
* @return [ArrayList]<[TextWatcher]>.
|
||||
*/
|
||||
private val textWatchers
|
||||
get() = base.resolve().optional(silent = true).firstFieldOrNull {
|
||||
get() = base.asResolver().optional(silent = true).firstFieldOrNull {
|
||||
name = "mListeners"
|
||||
superclass()
|
||||
}?.getQuietly<ArrayList<TextWatcher>>()
|
||||
|
@@ -29,7 +29,7 @@ import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import com.highcapable.betterandroid.ui.extension.view.layoutInflater
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||
import com.highcapable.pangutext.android.generated.PangutextAndroidProperties
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ class PanguTextFactory2 private constructor(private val base: LayoutInflater.Fac
|
||||
}
|
||||
val replacement = PanguTextFactory2(original)
|
||||
if (original != null)
|
||||
inflater.resolve().optional(silent = true).firstFieldOrNull {
|
||||
inflater.asResolver().optional(silent = true).firstFieldOrNull {
|
||||
name = "mFactory2"
|
||||
superclass()
|
||||
}?.setQuietly(replacement) ?: Log.e(PangutextAndroidProperties.PROJECT_NAME, "LayoutInflater.mFactory2 not found.")
|
||||
|
Reference in New Issue
Block a user