CircleIconButton

Composable Function
Android
@Composable
public fun CircleIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: () -> Unit,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    backgroundColor: ColorProvider? = GlanceTheme.colors.background,
    contentColor: ColorProvider = GlanceTheme.colors.onSurface,
    key: String? = null,
): Unit

Intended to fill the role of secondary icon button. Background color may be null to have the button display as an icon with a 48x48dp hit area.

Parameters

imageProvider the icon to be drawn in the button
contentDescription Text used by accessibility services to describe what this image represents. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar
onClick The action to be performed when this button is clicked.
modifier The modifier to be applied to this button.
enabled If false, the button will not be clickable.
backgroundColor The color to tint the button's background. May be null to make background transparent.
contentColor The color to tint the button's icon.
key A stable and unique key that identifies the action for this button. This ensures that the correct action is triggered, especially in cases of items that change order. If not provided we use the key that is automatically generated by the Compose runtime, which is unique for every exact code location in the composition tree.
Android
@Composable
public fun CircleIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: Action,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    backgroundColor: ColorProvider? = GlanceTheme.colors.background,
    contentColor: ColorProvider = GlanceTheme.colors.onSurface,
): Unit

Intended to fill the role of secondary icon button. Background color may be null to have the button display as an icon with a 48x48dp hit area.

Parameters

imageProvider the icon to be drawn in the button
contentDescription Text used by accessibility services to describe what this image represents. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar
onClick The action to be performed when this button is clicked.
modifier The modifier to be applied to this button.
enabled If false, the button will not be clickable.
backgroundColor The color to tint the button's background. May be null to make background transparent.
contentColor The color to tint the button's icon.