Object

OutlinedIconButtonDefaults

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
object OutlinedIconButtonDefaults

Properties

Android
val SmallIconSize = 16.dp
Android
val MediumIconSize = 20.dp
Android
val LargeIconSize = 28.dp
Android
val SmallButtonSize = 28.dp

The size of a small OutlinedIconButton

Android
val MediumButtonSize = 40.dp

The size of a medium OutlinedIconButton.

Android
val LargeButtonSize = 56.dp

The size of a large OutlinedIconButton.

Functions

shape

fun shape(
        shape: Shape = ContainerShape,
        focusedShape: Shape = shape,
        pressedShape: Shape = shape,
        disabledShape: Shape = shape,
        focusedDisabledShape: Shape = disabledShape,
    ) =
        ButtonShape(
            shape = shape,
            focusedShape = focusedShape,
            pressedShape = pressedShape,
            disabledShape = disabledShape,
            focusedDisabledShape = focusedDisabledShape,
        )

Creates a ButtonShape that represents the default container shapes used in an OutlinedIconButton.

Parameters

shape the shape used when the Button is enabled, and has no other Interactions.
focusedShape the shape used when the Button is enabled and focused.
pressedShape the shape used when the Button is enabled pressed.
disabledShape the shape used when the Button is not enabled.
focusedDisabledShape the shape used when the Button is not enabled and focused.

colors

@ReadOnlyComposable
    @Composable
    fun colors(
        containerColor: Color = Color.Transparent,
        contentColor: Color = MaterialTheme.colorScheme.onSurface,
        focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface,
        focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
        pressedContainerColor: Color = focusedContainerColor,
        pressedContentColor: Color = focusedContentColor,
        disabledContainerColor: Color = containerColor,
        disabledContentColor: Color = contentColor,
    ) =
        ButtonColors(
            containerColor = containerColor,
            contentColor = contentColor,
            focusedContainerColor = focusedContainerColor,
            focusedContentColor = focusedContentColor,
            pressedContainerColor = pressedContainerColor,
            pressedContentColor = pressedContentColor,
            disabledContainerColor = disabledContainerColor,
            disabledContentColor = disabledContentColor,
        )

Creates a ButtonColors that represents the default colors used in a OutlinedIconButton.

Parameters

containerColor the container color of this Button when enabled
contentColor the content color of this Button when enabled
focusedContainerColor the container color of this Button when enabled and focused
focusedContentColor the content color of this Button when enabled and focused
pressedContainerColor the container color of this Button when enabled and pressed
pressedContentColor the content color of this Button when enabled and pressed
disabledContainerColor the container color of this Button when not enabled
disabledContentColor the content color of this Button when not enabled

scale

fun scale(
        @FloatRange(from = 0.0) scale: Float = 1f,
        @FloatRange(from = 0.0) focusedScale: Float = 1.1f,
        @FloatRange(from = 0.0) pressedScale: Float = scale,
        @FloatRange(from = 0.0) disabledScale: Float = scale,
        @FloatRange(from = 0.0) focusedDisabledScale: Float = disabledScale,
    ) =
        ButtonScale(
            scale = scale,
            focusedScale = focusedScale,
            pressedScale = pressedScale,
            disabledScale = disabledScale,
            focusedDisabledScale = focusedDisabledScale,
        )

Creates a ButtonScale that represents the default scales used in an OutlinedIconButton. scales are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc.

Parameters

scale the scale to be used for this Button when enabled
focusedScale the scale to be used for this Button when focused
pressedScale the scale to be used for this Button when pressed
disabledScale the scale to be used for this Button when disabled
focusedDisabledScale the scale to be used for this Button when disabled and focused

border

@ReadOnlyComposable
    @Composable
    fun border(
        border: Border =
            Border(
                border =
                    BorderStroke(
                        width = 2.dp,
                        color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.4f),
                    ),
                shape = ContainerShape,
            ),
        focusedBorder: Border =
            Border(
                border = BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.onSurface),
                shape = ContainerShape,
            ),
        pressedBorder: Border =
            Border(
                border = BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.onSurface),
                shape = ContainerShape,
            ),
        disabledBorder: Border =
            Border(
                border =
                    BorderStroke(
                        width = 2.dp,
                        color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.2f),
                    ),
                shape = ContainerShape,
            ),
        focusedDisabledBorder: Border = disabledBorder,
    ) =
        ButtonBorder(
            border = border,
            focusedBorder = focusedBorder,
            pressedBorder = pressedBorder,
            disabledBorder = disabledBorder,
            focusedDisabledBorder = focusedDisabledBorder,
        )

Creates a ButtonBorder that represents the default Borders applied on an OutlinedIconButton in different Interaction states.

Parameters

border the Border to be used for this Button when enabled
focusedBorder the Border to be used for this Button when focused
pressedBorder the Border to be used for this Button when pressed
disabledBorder the Border to be used for this Button when disabled
focusedDisabledBorder the Border to be used for this Button when disabled and focused

glow

fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow) =
        ButtonGlow(glow = glow, focusedGlow = focusedGlow, pressedGlow = pressedGlow)

Creates a ButtonGlow that represents the default Glows used in an OutlinedIconButton.

Parameters

glow the Glow behind this Button when enabled
focusedGlow the Glow behind this Button when focused
pressedGlow the Glow behind this Button when pressed