KeyboardApp

interface KeyboardApp

The interface every App must implement.

Summary

Properties
String appId
The unique app id.
List<String>? keywords
List of keywords for Next Service Predictions.
Functions
Void initialize(listener: AppListener, configuration: AppConfiguration)
Invoked when the app is registered.
Void dispose()
Dispose the app and free resources until (if) initialize is called again.
View? open(parent: ViewGroup, theme: AppTheme, state: AppInputState)
Invoked when the app is requested to be opened.
Void close()
Invoked when the app is requested to be closed.
Void onConfigurationChanged(configuration: AppConfiguration)
Invoked when the app configuration changed.
Void onThemeChanged(theme: AppTheme)
Invoked when the app theme has changed.
Void onThemeUpdated(theme: AppTheme)
Invoked when the app theme has updated a dynamic value, like cycling background colors.
Void onInputStateChanged(state: AppInputState)
Invoked when the app input state has changed.
Drawable? appIcon(context: Context)
The icon of the app, in either circular or square shape.

Properties

appId

val appId: String

The unique app id.

keywords

val keywords: List<String>?

List of keywords for Next Service Predictions.

Functions

initialize

fun initialize(listener: AppListener, configuration: AppConfiguration)

Invoked when the app is registered.

Parameters
listener: AppListener A keyboard app listener to perform actions on the keyboard.
configuration: AppConfiguration Configuration of the input method service.

dispose

fun dispose()

Dispose the app and free resources until (if) initialize is called again.

open

fun open(parent: ViewGroup, theme: AppTheme, state: AppInputState): View?

Invoked when the app is requested to be opened.

Parameters
parent: ViewGroup The view group where the view can (or will) be attached.
theme: AppTheme The app theme in use when the app was requested to be opened.
state: AppInputState The keyboard state when the app was requested to be opened.
Returns
View? The view that will be attached to the frame. When null, no frame is opened and the app is not considered to be active.

close

fun close()

Invoked when the app is requested to be closed.

onConfigurationChanged

fun onConfigurationChanged(configuration: AppConfiguration)

Invoked when the app configuration changed.

Parameters
configuration: AppConfiguration Configuration of the new input method service

onThemeChanged

fun onThemeChanged(theme: AppTheme)

Invoked when the app theme has changed.

Parameters
theme: AppTheme The app theme in use when the app was requested to be opened

onThemeUpdated

fun onThemeUpdated(theme: AppTheme)

Invoked when the app theme has updated a dynamic value, like cycling background colors.

Parameters
theme: AppTheme The updated theme.

onInputStateChanged

fun onInputStateChanged(state: AppInputState)

Invoked when the app input state has changed.

Parameters
state: AppInputState The new app input state.

appIcon

fun appIcon(context: Context): Drawable?

The icon of the app, in either circular or square shape

Parameters
context: Context Context
Returns
Drawable? Icon of the app

If something needs to be added or if you find an error in our documentation, please let us know either on our GitHub or Discord.

Last updated on June 16, 2023