mirror of
https://github.com/BetterAndroid/Hikage.git
synced 2025-09-05 10:15:37 +08:00
refactor: migration to KavaRef
This commit is contained in:
@@ -39,7 +39,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation(projects.hikageCore)
|
||||
implementation(com.highcapable.yukireflection.api)
|
||||
implementation(com.highcapable.kavaref.kavaref.core)
|
||||
implementation(com.highcapable.kavaref.kavaref.extension)
|
||||
implementation(com.highcapable.betterandroid.ui.extension)
|
||||
implementation(com.highcapable.betterandroid.system.extension)
|
||||
implementation(androidx.core.core.ktx)
|
||||
|
@@ -31,7 +31,7 @@ import com.highcapable.hikage.core.Hikage
|
||||
import com.highcapable.hikage.core.base.HikageFactoryBuilder
|
||||
import com.highcapable.hikage.core.base.HikagePerformer
|
||||
import com.highcapable.hikage.core.base.Hikageable
|
||||
import com.highcapable.yukireflection.factory.current
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
|
||||
/**
|
||||
* @see PopupWindow.setContentView
|
||||
@@ -67,5 +67,5 @@ fun PopupWindow.setContentView(
|
||||
* @return [Context]
|
||||
*/
|
||||
private fun PopupWindow.requireContext() =
|
||||
current(ignored = true).field { name = "mContext" }.cast<Context?>()
|
||||
resolve().optional(silent = true).firstFieldOrNull { name = "mContext" }?.getQuietly<Context>()
|
||||
?: error("Hikage need a Context to create PopupWindow content view.")
|
Reference in New Issue
Block a user