Beagle v1.7 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
To create your custom action, follow the next steps:
@RegisterAction
that implements an Action
interface;execute
method;action
result.The value
attribute is a parameter example that can be declared in this class constructor. The following example shows an action with Toast receiving a text with a parameter:
@RegisterAction
data class CustomActionAndroid(
val value: String
) : Action {
override fun execute(rootView: RootView) {
Toast.makeText(
rootView.getContext(),
value,
Toast.LENGTH_LONG).show()
}
}
Button(
text = text,
styleId = styleId,
onPress = listOf(CustomActionAndroid("I'm a customized action"))
)
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.