-
Notifications
You must be signed in to change notification settings - Fork 67
Develop Custom Pluto Plugins (Beta)
With the latest architecture, Pluto now allows developers to write their own plugins, as per their needs.
Pluto architecture is currently evolving and is in the BETA phase, we are constantly adding new updates and improvements to the framework, which might break your plugin, so please keep watching the framework for the latest updates.
To start developing a plugin, add plugin dependency to your app module and sync your project.
dependencies {
implementation 'com.plutolib:plugin:LATEST_VERSION'
}
See the Releases page for the latest version
then override the Plugin.kt
class and implement the abstract methods.
class CustomPlugin(devIdentifier: String) : Plugin(devIdentifier) {
override fun getConfig(): PluginConfiguration {}
override fun getDeveloperDetails(): DeveloperDetails {}
override fun getView(): Fragment {}
override fun onPluginInstalled() {}
override fun onPluginDataCleared() {}
}
Once the methods are implemented, add your plugin to Pluto.
Pluto.Installer(this)
.addPlugin(CustomPlugin("custom_dev_id"))
.install()
🎉 Congratulations! Your plugin is ready to be used.
Now re-build and run your app, you will receive a notification from Pluto, use it to access Pluto UI.
You will see your plugin present on the selector screen.
Note: For more details about plugin development, refer to Demo Plugin implementation.