SquareIconButton

Functions summary

Unit
@Composable
SquareIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: Action,
    modifier: GlanceModifier,
    enabled: Boolean,
    backgroundColor: ColorProvider,
    contentColor: ColorProvider
)

Intended to fill the role of primary icon button or fab.

Unit
@Composable
SquareIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: () -> Unit,
    modifier: GlanceModifier,
    enabled: Boolean,
    backgroundColor: ColorProvider,
    contentColor: ColorProvider,
    key: String?
)

Intended to fill the role of primary icon button or fab.

Functions

SquareIconButton

@Composable
fun SquareIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: Action,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    backgroundColor: ColorProvider = GlanceTheme.colors.primary,
    contentColor: ColorProvider = GlanceTheme.colors.onPrimary
): Unit

Intended to fill the role of primary icon button or fab.

Parameters
imageProvider: ImageProvider

the icon to be drawn in the button

contentDescription: String?

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: Action

The action to be performed when this button is clicked.

modifier: GlanceModifier = GlanceModifier

The modifier to be applied to this button.

enabled: Boolean = true

If false, the button will not be clickable.

backgroundColor: ColorProvider = GlanceTheme.colors.primary

The color to tint the button's background.

contentColor: ColorProvider = GlanceTheme.colors.onPrimary

The color to tint the button's icon.

SquareIconButton

@Composable
fun SquareIconButton(
    imageProvider: ImageProvider,
    contentDescription: String?,
    onClick: () -> Unit,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    backgroundColor: ColorProvider = GlanceTheme.colors.primary,
    contentColor: ColorProvider = GlanceTheme.colors.onPrimary,
    key: String? = null
): Unit

Intended to fill the role of primary icon button or fab.

Parameters
imageProvider: ImageProvider

the icon to be drawn in the button

contentDescription: String?

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: () -> Unit

The action to be performed when this button is clicked.

modifier: GlanceModifier = GlanceModifier

The modifier to be applied to this button.

enabled: Boolean = true

If false, the button will not be clickable.

backgroundColor: ColorProvider = GlanceTheme.colors.primary

The color to tint the button's background.

contentColor: ColorProvider = GlanceTheme.colors.onPrimary

The color to tint the button's icon.

key: String? = null

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.