InboxUIState
Sealed interface representing different states for the Inbox UI.
States
Loading
Indicates that the inbox is currently fetching content from the device cache.
Kotlin
Copied to your clipboardobject Loading : InboxUIState
Success
Indicates that the inbox content was loaded successfully. Contains the inbox template and list of content cards.
Kotlin
Copied to your clipboarddata class Success(val template: InboxTemplate,val items: List<AepUI<*, *>>) : InboxUIState
Properties
| Property | Type | Description |
|---|---|---|
template | The properties to be used for rendering the inbox (heading, layout, capacity, etc.). | |
items | List<AepUI<*, *>> | List of AepUI elements representing content cards to display in the inbox. |
Error
Indicates that an error occurred while loading inbox content.
Kotlin
Copied to your clipboarddata class Error(val error: Throwable) : InboxUIState
Properties
| Property | Type | Description |
|---|---|---|
error | Throwable | The throwable that caused the error. |
Usage Example
Kotlin
Copied to your clipboardval inboxUIState by viewModel.inboxUIState.collectAsStateWithLifecycle()when (inboxUIState) {is InboxUIState.Loading -> {// Show loading indicator}is InboxUIState.Success -> {val successState = inboxUIState as InboxUIState.Successval cardCount = successState.items.sizeval heading = successState.template.heading// Render inbox with cards}is InboxUIState.Error -> {val errorState = inboxUIState as InboxUIState.Error// Show error message: errorState.error.message}}
