OfflinePackListItemDefaults
Functions
Link copied to clipboard
fun LeadingContent(pack: OfflinePack, completedIcon: @Composable () -> Unit = {
Icon(
imageVector = vectorResource(Res.drawable.check_circle_filled),
contentDescription = stringResource(Res.string.offline_pack_complete),
)
}, pausedIcon: @Composable () -> Unit = {
Icon(
imageVector = vectorResource(Res.drawable.pause_circle_filled),
contentDescription = stringResource(Res.string.offline_pack_paused),
)
}, downloadingIcon: @Composable () -> Unit = { DownloadProgressCircle(pack) }, errorIcon: @Composable () -> Unit = {
Icon(
imageVector = vectorResource(Res.drawable.error_filled),
contentDescription = stringResource(Res.string.offline_pack_error),
tint = MaterialTheme.colorScheme.error,
)
}, warningIcon: @Composable () -> Unit = {
Icon(
imageVector = vectorResource(Res.drawable.warning_filled),
contentDescription = stringResource(Res.string.offline_pack_warning),
)
})
The default leading content for an OfflinePackListItem. It includes a CircularProgressIndicator for in-progress downloads, and otherwise an Icon representing the status of the pack.
Link copied to clipboard
fun SupportingContent(progress: DownloadProgress, completedContent: @Composable (DownloadProgress.Healthy) -> Unit = {
Text(it.completedBytesString())
}, downloadingContent: @Composable (DownloadProgress.Healthy) -> Unit = {
Text(stringResource(Res.string.offline_pack_downloading_status, it.completedBytesString()))
}, pausedContent: @Composable (DownloadProgress.Healthy) -> Unit = {
Text(stringResource(Res.string.offline_pack_paused_status, it.completedBytesString()))
}, errorContent: @Composable (DownloadProgress.Error) -> Unit = {
Text(stringResource(Res.string.offline_pack_error_status, it.message))
}, tileLimitExceededContent: @Composable (DownloadProgress.TileLimitExceeded) -> Unit = {
Text(stringResource(Res.string.offline_pack_tile_limit_exceeded, it.limit))
}, unknownContent: @Composable (DownloadProgress.Unknown) -> Unit = {
Text(stringResource(Res.string.offline_pack_unknown_status))
})
Displays the pack's download status and size, or its error or tile limit status.
Link copied to clipboard
The default trailing content for an OfflinePackListItem. It includes a button to pause, resume, or update the pack, depending on the pack's current status. It also includes a delete button.