RippleUtils

public class RippleUtils
extends Object

java.lang.Object
   ↳ com.google.android.material.ripple.RippleUtils


Utils class for ripples.

Summary

Fields

public static final boolean USE_FRAMEWORK_RIPPLE

Public methods

static ColorStateList convertToRippleDrawableColor(ColorStateList rippleColor)

Converts the given color state list to one that can be passed to a RippleDrawable.

Inherited methods

From class java.lang.Object

Fields

USE_FRAMEWORK_RIPPLE

boolean USE_FRAMEWORK_RIPPLE

Public methods

convertToRippleDrawableColor

ColorStateList convertToRippleDrawableColor (ColorStateList rippleColor)

Converts the given color state list to one that can be passed to a RippleDrawable.

The passed in stateful ripple color can contain colors for these states:

  • android:state_pressed="true"
  • android:state_focused="true" and android:state_hovered="true"
  • android:state_focused="true"
  • android:state_hovered="true"
  • Default unselected state - transparent color. TODO: remove

For selectable components, the ripple color may contain additional colors for these states:

  • android:state_pressed="true" and android:state_selected="true"
  • android:state_focused="true" and android:state_hovered="true" and android:state_selected="true"
  • android:state_focused="true" and android:state_selected="true"
  • android:state_hovered="true" and android:state_selected="true"
  • Default selected state - transparent color.

Parameters
rippleColor ColorStateList

Returns
ColorStateList