OfflinePackListItemDefaults

Functions

Link copied to clipboard
@Composable
fun LeadingContent(pack: OfflinePack, offlineManager: OfflineManager = rememberOfflineManager(), completedIcon: @Composable () -> Unit = { Icon( imageVector = vectorResource(Res.drawable.check_circle_filled), contentDescription = "Complete", ) }, pausedIcon: @Composable () -> Unit = { Icon( imageVector = vectorResource(Res.drawable.pause_circle_filled), contentDescription = "Paused", ) }, downloadingIcon: @Composable () -> Unit = { DownloadProgressCircle(pack) }, errorIcon: @Composable () -> Unit = { Icon( imageVector = vectorResource(Res.drawable.error_filled), contentDescription = "Error", tint = MaterialTheme.colorScheme.error, ) }, warningIcon: @Composable () -> Unit = { Icon( imageVector = vectorResource(Res.drawable.warning_filled), contentDescription = "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
@Composable
fun SupportingContent(progress: DownloadProgress, completedContent: @Composable (DownloadProgress.Healthy) -> Unit = { Text(it.completedBytesString()) }, downloadingContent: @Composable (DownloadProgress.Healthy) -> Unit = { Text("Downloading: ${it.completedBytesString()}") }, pausedContent: @Composable (DownloadProgress.Healthy) -> Unit = { Text("Paused: ${it.completedBytesString()}") }, errorContent: @Composable (DownloadProgress.Error) -> Unit = { Text("Error: ${it.message}") }, tileLimitExceededContent: @Composable (DownloadProgress.TileLimitExceeded) -> Unit = { Text("Tile limit exceeded: ${it.limit} tiles") }, unknownContent: @Composable (DownloadProgress.Unknown) -> Unit = { Text("Unknown status") })

The default supporting content for an OfflinePackListItem. It includes a Text describing the status of the pack; typically the download status and size. If the pack is in an error or other unhealthy state, it'll be indicated here.

Link copied to clipboard
@Composable
fun TrailingContent(pack: OfflinePack, offlineManager: OfflineManager = rememberOfflineManager(), coroutineScope: CoroutineScope = rememberCoroutineScope())

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.