androidx.ui.material.ripple

Classes

RippleIndication

Material implementation of IndicationInstance that expresses indication via ripples.

RippleTheme

Defines the appearance and the behavior for 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.

Ripple responds to a tap by starting a new RippleEffect animation. For creating an effect it uses the RippleTheme.factory.

By default this Indication with default parameters will be provided by MaterialTheme. You can also manually create a RippleIndication and provide it to Modifier.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.

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

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

Ripple responds to a tap by starting a new RippleEffect animation. For creating an effect it uses the RippleTheme.factory.

import androidx.ui.foundation.Text
import androidx.ui.foundation.clickable
import androidx.ui.material.ripple.ripple

Text(text = "Clickable text", modifier = Modifier.ripple().clickable { /* do something */ })
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.