androidx.ui.material.ripple

Classes

RippleTheme

Defines the appearance and the behavior for Ripples.

Top-level functions summary

Unit
Ripple(bounded: Boolean, radius: Dp? = null, color: Color? = null, enabled: Boolean = true, children: () -> Unit)

Ripple is a visual indicator for a pressed state.

Top-level properties summary

Ambient<RippleTheme>

Top-level functions

Ripple

@Composable fun Ripple(
    bounded: Boolean,
    radius: Dp? = null,
    color: Color? = null,
    enabled: Boolean = true,
    children: () -> Unit
): Unit

Ripple is a visual indicator for a pressed state.

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

import androidx.ui.core.Text
import androidx.ui.foundation.Clickable
import androidx.ui.material.ripple.Ripple

Ripple(bounded = true) {
    Clickable(onClick = { /** do something */ }) {
        Text(text = "Clickable text")
    }
}
Parameters
bounded: Boolean 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? = null The Ripple color is usually the same color used by the text or iconography in the component. If null is provided the color will be calculated by RippleTheme.defaultColor.
enabled: Boolean = true The ripple effect will not start if false is provided.

Top-level properties

CurrentRippleTheme

val CurrentRippleTheme: Ambient<RippleTheme>