mirror of
https://github.com/BetterAndroid/Hikage.git
synced 2025-09-05 10:15:37 +08:00
refactor: update KavaRef usage to 1.0.1
This commit is contained in:
@@ -69,9 +69,9 @@ libraries:
|
|||||||
version: 6.1
|
version: 6.1
|
||||||
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
|
||||||
com.highcapable.pangutext:
|
com.highcapable.pangutext:
|
||||||
pangutext-android:
|
pangutext-android:
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
|
@@ -61,6 +61,7 @@ import com.highcapable.hikage.core.base.HikageView
|
|||||||
import com.highcapable.hikage.core.base.PerformerException
|
import com.highcapable.hikage.core.base.PerformerException
|
||||||
import com.highcapable.hikage.core.base.ProvideException
|
import com.highcapable.hikage.core.base.ProvideException
|
||||||
import com.highcapable.hikage.core.extension.ResourcesScope
|
import com.highcapable.hikage.core.extension.ResourcesScope
|
||||||
|
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||||
import com.highcapable.kavaref.extension.classOf
|
import com.highcapable.kavaref.extension.classOf
|
||||||
import com.highcapable.kavaref.extension.createInstanceOrNull
|
import com.highcapable.kavaref.extension.createInstanceOrNull
|
||||||
@@ -892,7 +893,7 @@ class Hikage private constructor(private val factories: List<HikageFactory>) {
|
|||||||
*/
|
*/
|
||||||
private fun createDefaultLayoutParams(lparams: ViewGroup.LayoutParams? = null): ViewGroup.LayoutParams {
|
private fun createDefaultLayoutParams(lparams: ViewGroup.LayoutParams? = null): ViewGroup.LayoutParams {
|
||||||
val wrapped = lparams?.let {
|
val wrapped = lparams?.let {
|
||||||
parent?.resolve()?.optional(silent = true)?.firstMethodOrNull {
|
parent?.asResolver()?.optional(silent = true)?.firstMethodOrNull {
|
||||||
name = "generateLayoutParams"
|
name = "generateLayoutParams"
|
||||||
parameters(ViewGroup.LayoutParams::class)
|
parameters(ViewGroup.LayoutParams::class)
|
||||||
superclass()
|
superclass()
|
||||||
|
@@ -31,7 +31,7 @@ import com.highcapable.hikage.core.Hikage
|
|||||||
import com.highcapable.hikage.core.base.HikageFactoryBuilder
|
import com.highcapable.hikage.core.base.HikageFactoryBuilder
|
||||||
import com.highcapable.hikage.core.base.HikagePerformer
|
import com.highcapable.hikage.core.base.HikagePerformer
|
||||||
import com.highcapable.hikage.core.base.Hikageable
|
import com.highcapable.hikage.core.base.Hikageable
|
||||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see PopupWindow.setContentView
|
* @see PopupWindow.setContentView
|
||||||
@@ -67,5 +67,5 @@ fun PopupWindow.setContentView(
|
|||||||
* @return [Context]
|
* @return [Context]
|
||||||
*/
|
*/
|
||||||
private fun PopupWindow.requireContext() =
|
private fun PopupWindow.requireContext() =
|
||||||
resolve().optional(silent = true).firstFieldOrNull { name = "mContext" }?.getQuietly<Context>()
|
asResolver().optional(silent = true).firstFieldOrNull { name = "mContext" }?.getQuietly<Context>()
|
||||||
?: error("Hikage need a Context to create PopupWindow content view.")
|
?: error("Hikage need a Context to create PopupWindow content view.")
|
Reference in New Issue
Block a user