Package-level declarations

Types

Link copied to clipboard
@Immutable
sealed interface AsyncImageResource
Link copied to clipboard
@Immutable
sealed interface ImageResource

A sealed class to represent an image resource. It can be either a vector image or a drawable. This is useful to abstract the image resource type and use it in a composable function. The identifier can be used for tests.

Link copied to clipboard
Link copied to clipboard
interface StringResource

Functions

Link copied to clipboard
fun AppTopAppBar(modifier: Modifier = Modifier, title: @Composable () -> Unit, navigationIcon: @Composable () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {})
Link copied to clipboard
fun AsyncButton(modifier: Modifier = Modifier, isLoading: Boolean = false, enabled: Boolean = isLoading.not(), shape: Shape = ButtonDefaults.shape, containerColor: Color = ButtonDefaults.buttonColors().containerColor, contentColor: Color = ButtonDefaults.buttonColors().contentColor, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, onClick: () -> Unit = {}, content: @Composable RowScope.() -> Unit)

A button that renders a circular progress CircularProgressIndicator in case of loading or content otherwise

Link copied to clipboard
Link copied to clipboard
fun AsyncImageResourceComposable(imageResource: AsyncImageResource, modifier: Modifier = Modifier, loadingContent: @Composable BoxScope.() -> Unit = { ShimmerEffectBox(modifier = Modifier.matchParentSize()) }, errorContent: @Composable BoxScope.(Throwable) -> Unit = { Box(Modifier.matchParentSize()) { Text("Error loading image", Modifier.align(Alignment.Center)) } }, tint: Color = Colors.primary)

Composable function to display an icon using an ImageResource.

Link copied to clipboard
fun AsyncSwitch(modifier: Modifier = Modifier, isLoading: Boolean = false, checked: Boolean, onCheckedChange: (Boolean) -> Unit, enabled: Boolean = isLoading.not())
Link copied to clipboard
fun AsyncTextButton(text: String, modifier: Modifier = Modifier, isLoading: Boolean = false, enabled: Boolean = isLoading.not(), shape: Shape = ButtonDefaults.shape, containerColor: Color = ButtonDefaults.buttonColors().containerColor, textColor: Color = ButtonDefaults.buttonColors().contentColor, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, onClick: () -> Unit = {})

A button that renders a circular progress CircularProgressIndicator in case of loading or text otherwise

Link copied to clipboard
fun Button(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, content: @Composable RowScope.() -> Unit)

A button of the Spezi design system with customizable content.

Link copied to clipboard
Link copied to clipboard
fun CircleShimmerEffect(modifier: Modifier, duration: Int = ShimmerEffectDefaults.durationMillis, color: Color = ShimmerEffectDefaults.color)

Renders a circle Compose Box with a shimmer loading effect

Link copied to clipboard
fun CommonScaffold(title: String, modifier: Modifier = Modifier, content: @Composable ColumnScope.() -> Unit)
Link copied to clipboard
fun DefaultElevatedCard(modifier: Modifier = Modifier, shape: Shape = CardDefaults.shape, content: @Composable ColumnScope.() -> Unit)

Default Material Design elevated card.

Link copied to clipboard

Applies the height of the font size, useful when declaring shimmer effects to replicate a loading text

Link copied to clipboard
fun ImageResourceComposable(imageResource: ImageResource, modifier: Modifier = Modifier, tint: Color = Colors.primary)

Composable function to display an icon using an ImageResource.

Link copied to clipboard

A composable that notifies the lifecycle events of the current lifecycle owner

Link copied to clipboard
fun PermissionRequester(missingPermissions: List<String>?, onGranted: (String) -> Unit)
Link copied to clipboard
fun RectangleShimmerEffect(modifier: Modifier, duration: Int = ShimmerEffectDefaults.durationMillis, color: Color = ShimmerEffectDefaults.color)

Renders a rectangle Compose Box with a shimmer loading effect

Link copied to clipboard
fun RepeatingLazyColumn(modifier: Modifier = Modifier, itemCount: Int = DEFAULT_REPEATING_ITEMS_COUNT, content: @Composable LazyItemScope.() -> Unit)

Renders a lazy column with itemCount same contents. Helpful when rendering loading list items

Link copied to clipboard
fun SecondaryText(text: String, modifier: Modifier = Modifier)
Link copied to clipboard
fun ShimmerEffectBox(modifier: Modifier = Modifier, shape: Shape = ShimmerEffectDefaults.shape, duration: Int = ShimmerEffectDefaults.durationMillis, color: Color = ShimmerEffectDefaults.color)

Renders a Compose Box with a shimmer loading effect

Link copied to clipboard
Link copied to clipboard
fun VerticalSpacer(height: Dp = Spacings.medium)