We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

ShowTemplate Event for Android


Dependencies

The Piano Composer Show Template is available as an AAR via Maven Central. To add dependencies, open your project’s build.gradle/build.gradle.kts and update the dependencies block as follows:

Kotlin DSL

dependencies {
    implementation("io.piano.android:composer-show-template:$VERSION")
}

Usage

Add code into your ShowTemplate listener.

// Use one of these
ShowTemplateController(showTemplateEvent, customJavascriptInterface).show(activity)
ShowTemplateController(showTemplateEvent, customJavascriptInterface).show(activity, inlineWebViewProvider)

How to show templates inline

First, you need to prepare some content with a webview placed inline:

1.png

Then, you can target this webview in Composer by adding the ID of the webview into the inline container selector field:

2.png

This will result in the template being shown inline in your Android app. For example like this:

3.png

Last updated: