mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-08-06 11:31:45 +08:00
give openSettings the context
This commit is contained in:
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"githubPullRequests.ignoredPullRequestBranches": [
|
||||
"master"
|
||||
]
|
||||
}
|
@ -65,5 +65,5 @@ abstract class Plugin {
|
||||
/**
|
||||
* This will add a button in the settings allowing you to add custom settings
|
||||
*/
|
||||
var openSettings: (() -> Unit)? = null
|
||||
var openSettings: ((context: Context) -> Unit)? = null
|
||||
}
|
@ -89,7 +89,7 @@ class PluginAdapter(
|
||||
itemView.action_settings?.isVisible = true
|
||||
itemView.action_settings.setOnClickListener {
|
||||
try {
|
||||
plugin.openSettings!!.invoke()
|
||||
plugin.openSettings!!.invoke(itemView.context)
|
||||
} catch (e: Throwable) {
|
||||
Log.e("PluginAdapter", "Failed to open ${metadata.name} settings: ${Log.getStackTraceString(e)}")
|
||||
}
|
||||
|
Reference in New Issue
Block a user