Renderer


@RequiresApi(api = Build.VERSION_CODES.R)
class Renderer


Renderer class responsible for rendering the inline suggestion UI.

Summary

Public functions

java-static PendingIntent?

Returns a PendingIntent that will be launched on long clicking the UI to show attribution information via a android.app.Dialog.

java-static Bundle

Returns all the supported versions wrapped in a Bundle.

java-static View?
render(context: Context, content: Slice, styles: Bundle)

Public functions

getAttributionIntent

Added in 1.1.0
java-static fun getAttributionIntent(content: Slice): PendingIntent?

Returns a PendingIntent that will be launched on long clicking the UI to show attribution information via a android.app.Dialog.

The attribution UI indicates to the user the source of the UI content.

Parameters
content: Slice

the UI content which contains a PendingIntent representing the attribution information

getSupportedInlineUiVersionsAsBundle

Added in 1.1.0
java-static fun getSupportedInlineUiVersionsAsBundle(): Bundle

Returns all the supported versions wrapped in a Bundle.

render

Added in 1.1.0
java-static fun render(context: Context, content: Slice, styles: Bundle): View?
Parameters
context: Context

the context used to render the view

content: Slice

represents the UI content

styles: Bundle

contains a mapping from UI version to corresponding UI style specification

Returns
View?

a view rendered based on the provided UI content and the style with corresponding version or null when the UI version indicated by the slice is either unsupported by the Renderer, or not provided in the styles.