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