give openSettings the context
This commit is contained in:
parent
416d2b67b9
commit
e502be5972
|
@ -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
|
* 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?.isVisible = true
|
||||||
itemView.action_settings.setOnClickListener {
|
itemView.action_settings.setOnClickListener {
|
||||||
try {
|
try {
|
||||||
plugin.openSettings!!.invoke()
|
plugin.openSettings!!.invoke(itemView.context)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
Log.e("PluginAdapter", "Failed to open ${metadata.name} settings: ${Log.getStackTraceString(e)}")
|
Log.e("PluginAdapter", "Failed to open ${metadata.name} settings: ${Log.getStackTraceString(e)}")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue