Google is committed to advancing racial equity for Black communities. See how.

androidx.ui.material.ripple

Classes

RippleIndication

Material implementation of IndicationInstance that expresses indication via ripples.

Top-level functions summary

RippleIndication
RippleIndication(bounded: Boolean = true, radius: Dp? = null, color: Color = Color.Unset)

Material implementation of IndicationInstance that expresses indication via ripples.

Top-level properties summary

ProvidableAmbient<RippleTheme>

Ambient used for providing RippleTheme down the tree.

Extension functions summary

For Modifier
Modifier
Modifier.ripple(bounded: Boolean = true, radius: Dp? = null, color: Color = Color.Unset, enabled: Boolean = true, clock: AnimationClockObservable? = null)

Ripple is a Modifier which draws the visual indicator for a pressed state.

Top-level functions

RippleIndication

@Composable fun RippleIndication(
    bounded: Boolean = true,
    radius: Dp? = null,
    color: Color = Color.Unset
): RippleIndication

Material implementation of IndicationInstance that expresses indication via ripples. This IndicationInstance will be used by default in Modifier.indication() if you have a MaterialTheme set in your hierarchy.

RippleIndication responds to Interaction.Pressed by starting a new RippleAnimation, and responds to other interactions by showing a fixed state layer.

By default this Indication with default parameters will be provided by MaterialTheme through androidx.ui.foundation.IndicationAmbient, and hence used in interactions such as androidx.ui.foundation.clickable out of the box. You can also manually create a RippleIndication and provide it to androidx.ui.foundation.indication in order to customize its appearance.

Parameters
bounded: Boolean = true If true, ripples are clipped by the bounds of the target layout. Unbounded ripples always animate from the target layout center, bounded ripples animate from the touch position.
radius: Dp? = null Effects grow up to this size. If null is provided the size would be calculated based on the target layout size.
color: Color = Color.Unset The Ripple color is usually the same color used by the text or iconography in the component. If Color.Unset is provided the color will be calculated by RippleTheme.defaultColor. This color will then have RippleTheme.rippleOpacity applied

Top-level properties

RippleThemeAmbient

val RippleThemeAmbient: ProvidableAmbient<RippleTheme>

Ambient used for providing RippleTheme down the tree.

Extension functions

ripple

fun Modifier.ripple(
    bounded: Boolean = true,
    radius: Dp? = null,
    color: Color = Color.Unset,
    enabled: Boolean = true,
    clock: AnimationClockObservable? = null
): Modifier

Deprecated.

Ripple is a Modifier which draws the visual indicator for a pressed state.

Ripple responds to a tap by starting a new ripple animation.

Parameters
bounded: Boolean = true If true, ripples are clipped by the bounds of the target layout. Unbounded ripples always animate from the target layout center, bounded ripples animate from the touch position.
radius: Dp? = null Effects grow up to this size. If null is provided the size would be calculated based on the target layout size.
color: Color = Color.Unset The Ripple color is usually the same color used by the text or iconography in the component. If Color.Unset is provided the color will be calculated by RippleTheme.defaultColor.
clock: AnimationClockObservable? = null The animation clock observable that will drive this ripple effect
enabled: Boolean = true The ripple effect will not start if false is provided.