NoDataScreen

fun NoDataScreen(text: Int = R.string.try_again, textMessage: Int = R.string.try_again, icon: ToolkitIcon = ToolkitIcon.Vector(Icons.Default.Info), showRetry: Boolean = false, onRetry: () -> Unit = {}, showAd: Boolean = true, isError: Boolean = false, paddingValues: PaddingValues = PaddingValues(), message: String? = null)(source)

Displays a placeholder screen when no data is available.

A progress indicator with an optional icon is shown in the center of the screen. A retry button and native ad card can be toggled through showRetry and showAd respectively. When isError is true error colors are used.

Parameters

text

Label for the retry action button.

textMessage

Message describing the empty state.

icon

Icon rendered at the center of the indicator: any ToolkitIcon, such as a drawable or an animated icon. An overload takes an ImageVector.

showRetry

Whether to display the retry button.

onRetry

Callback invoked when the retry button is pressed.

showAd

Whether a NoDataNativeAdCard should be displayed.

isError

Shows the indicator with error styling when true.

message

The message as text, for one that is not a string resource, such as a Loadable.Failed message. Shown instead of textMessage when given.


fun NoDataScreen(icon: ImageVector, text: Int = R.string.try_again, textMessage: Int = R.string.try_again, showRetry: Boolean = false, onRetry: () -> Unit = {}, showAd: Boolean = true, isError: Boolean = false, paddingValues: PaddingValues = PaddingValues(), message: String? = null)(source)

NoDataScreen with an ImageVector icon.