interface KeyboardApp
The interface every App must implement.
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. |
val appId: String
The unique app id.
val keywords: List<String>?
List of keywords for Next Service Predictions.
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. |
fun dispose()
Dispose the app and free resources until (if) initialize is called again.
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. |
fun close()
Invoked when the app is requested to be closed.
fun onConfigurationChanged(configuration: AppConfiguration)
Invoked when the app configuration changed.
Parameters | |
---|---|
configuration: AppConfiguration |
Configuration of the new input method service |
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 |
fun onThemeUpdated(theme: AppTheme)
Invoked when the app theme has updated a dynamic value, like cycling background colors.
Parameters | |
---|---|
theme: AppTheme |
The updated theme. |
fun onInputStateChanged(state: AppInputState)
Invoked when the app input state has changed.
Parameters | |
---|---|
state: AppInputState |
The new app input state. |
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 |