BlazeWidgetItemClickHandlerState - Android
BlazeWidgetItemClickHandlerState represents the different states when a widget is clicked within the application.
| Value | Description |
|---|---|
| HANDLED_BY_APP | When the state is HANDLED_BY_APP, it indicates that the application is responsible for handling the click event. In this state, the SDK does not intervene, and the player isn't initiated by the SDK. This allows the application developers to define custom behaviors or actions when a widget is clicked, without triggering the default SDK player actions. |
| SDK_SHOULD_HANDLE | When the state is SDK_SHOULD_HANDLE, it signifies that the SDK should take over the handling of the click event. In this scenario, the SDK will initiate the player and will start to play content within the player. |
BlazeWidgetItemClickParams
Parameters passed to onWidgetItemClickHandler when a widget item is clicked.
data class BlazeWidgetItemClickParams(
val widgetId: String,
val contentIndex: Int,
val contentId: String,
val extraInfo: Map<String, String>,
val contentThumbnailUrl: String?
)| Property | Type | Description |
|---|---|---|
| widgetId | String | The ID of the widget containing the clicked item. |
| contentIndex | Int | The zero-based index of the clicked item within the widget. |
| contentId | String | The unique content ID of the clicked item. |
| extraInfo | Map<String, String> | Additional key-value metadata associated with the clicked item. Empty map if no metadata is present. |
| contentThumbnailUrl | String? | The URL of the clicked item's main thumbnail, matching the thumbnail rendered by the widget. null when the item has no thumbnail. Available for Stories, Moments, and Videos widgets. |
Usage example
binding.momentsRowWidget.initWidget(
// ...
onWidgetItemClickHandler = { params: BlazeWidgetItemClickParams ->
Log.d("Widget", "Clicked item ${params.contentId}, extraInfo: ${params.extraInfo}")
params.contentThumbnailUrl?.let { thumbnailUrl ->
Log.d("Widget", "Thumbnail URL: $thumbnailUrl")
}
BlazeWidgetItemClickHandlerState.SDK_SHOULD_HANDLE
}
)Updated 22 days ago
Did this page help you?
