# CircularRevealCardView

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/circularreveal/cardview/CircularRevealCardView.java)

*** ** * ** ***


```
public class CircularRevealCardView extends MaterialCardView implements CircularRevealWidget
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [com.google.android.material.card.MaterialCardView](https://developer.android.com/reference/com/google/android/material/card/MaterialCardView) ||
|   | ↳ | [com.google.android.material.circularreveal.cardview.CircularRevealCardView](https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView) |

Known direct subclasses [TransformationChildCard](https://developer.android.com/reference/com/google/android/material/transformation/TransformationChildCard)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/transformation/TransformationChildCard` | **This class is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/transition/MaterialContainerTransform` instead. <br /> |

*** ** * ** ***

A CircularRevealWidget wrapper for `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#CircularRevealCardView(Context)(Context context)` |
| `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#CircularRevealCardView(Context,AttributeSet)(Context context, AttributeSet attrs)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#actualDraw(Canvas)(Canvas canvas)` Calls super#draw(Canvas). |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#actualIsOpaque()()` Calls super#isOpaque(). |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#buildCircularRevealCache()()` Prepares the reveal info property to be modified. |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#destroyCircularRevealCache()()` Cleans up after the reveal info property is reset. |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#draw(Canvas)(Canvas canvas)` Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#getCircularRevealOverlayDrawable()()` Returns the circular reveal overlay drawable if one exists, or null. |
| `int` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#getCircularRevealScrimColor()()` Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`. |
| `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealWidget.RevealInfo` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#getRevealInfo()()` Returns the current reveal info if one exists, or null. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#isOpaque()()` Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`. |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#setCircularRevealOverlayDrawable(Drawable)(Drawable drawable)` Sets the circular reveal overlay drawable, which is an icon that's drawn above everything else, including the circular reveal scrim color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#setCircularRevealScrimColor(int)(int color)` Sets the circular reveal scrim color, which is a color that's drawn above this widget's contents. |
| `void` | `https://developer.android.com/reference/com/google/android/material/circularreveal/cardview/CircularRevealCardView#setRevealInfo(com.google.android.material.circularreveal.CircularRevealWidget.RevealInfo)(https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealWidget.RevealInfo revealInfo)` Sets the current reveal info. |

| ### Inherited Constants |
|---|
| From [com.google.android.material.card.MaterialCardView](https://developer.android.com/reference/com/google/android/material/card/MaterialCardView) |---|---| | `static final int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#CHECKED_ICON_GRAVITY_BOTTOM_END()` Gravity used to position the checked icon at the bottom\|end of the Card. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#CHECKED_ICON_GRAVITY_BOTTOM_START()` Gravity used to position the checked icon at the bottom\|start of the Card. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#CHECKED_ICON_GRAVITY_TOP_END()` Gravity used to position the checked icon at the top\|end of the Card. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#CHECKED_ICON_GRAVITY_TOP_START()` Gravity used to position the checked icon at the top\|start of the Card. | |

| ### Inherited methods |
|---|
| From [com.google.android.material.card.MaterialCardView](https://developer.android.com/reference/com/google/android/material/card/MaterialCardView) |---|---| | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCardBackgroundColor()()` | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCardForegroundColor()()` Sets the ripple color for this card. | | `Drawable` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCheckedIcon()()` Returns this cards's checked icon. | | `int` | `@https://developer.android.com/reference/com/google/android/material/card/MaterialCardView.CheckedIconGravity https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCheckedIconGravity()()` Gets the checked icon gravity for this card | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCheckedIconMargin()()` | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCheckedIconSize()()` | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getCheckedIconTint()()` Returns the android.content.res.ColorStateList used to tint the checked icon. | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getContentPaddingBottom()()` | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getContentPaddingLeft()()` | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getContentPaddingRight()()` | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getContentPaddingTop()()` | | `float` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getProgress()()` Returns the interpolation on the Shape Path of the card. | | `float` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getRadius()()` | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getRippleColor()()` Gets the ripple color for this card. | | `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getShapeAppearanceModel()()` Due to limitations in the current implementation, if you modify the returned object call `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)` again with the modified value to propagate the required changes. | | `int` | `[getStrokeColor](https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getStrokeColor())()` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getStrokeColorStateList()` <br /> | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getStrokeColorStateList()()` Returns the stroke ColorStateList of this card view. | | `int` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#getStrokeWidth()()` Returns the stroke width of this card view. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#isCheckable()()` Returns whether this Card is checkable. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#isChecked()()` | | `boolean` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#isDragged()()` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#onAttachedToWindow()()` | | `int[]` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#onCreateDrawableState(int)(int extraSpace)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#onInitializeAccessibilityEvent(AccessibilityEvent)(AccessibilityEvent accessibilityEvent)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)(AccessibilityNodeInfo info)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#onMeasure(int,int)(int widthMeasureSpec, int heightMeasureSpec)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setBackground(Drawable)(Drawable drawable)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setBackgroundDrawable(Drawable)(Drawable drawable)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCardBackgroundColor(ColorStateList)(ColorStateList color)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCardBackgroundColor(int)(int color)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCardElevation(float)(float elevation)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCardForegroundColor(ColorStateList)(ColorStateList foregroundColor)` Sets the foreground color for this card. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckable(boolean)(boolean checkable)` Sets whether this Card is checkable. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setChecked(boolean)(boolean checked)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIcon(Drawable)(Drawable checkedIcon)` Sets this card's checked icon. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconGravity(int)( @https://developer.android.com/reference/com/google/android/material/card/MaterialCardView.CheckedIconGravity int checkedIconGravity )` Sets the checked icon gravity for this card | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconMargin(int)(int checkedIconMargin)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconMarginResource(int)(int checkedIconMarginResId)` Sets the margin of the checked icon using a resource id. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconResource(int)(int id)` Sets this card's checked icon using a resource id. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconSize(int)(int checkedIconSize)` Sets the size of the checked icon | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconSizeResource(int)(int checkedIconSizeResId)` Sets the size of the checked icon using a resource id. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setCheckedIconTint(ColorStateList)(ColorStateList checkedIconTint)` Sets this checked icon color tint using the specified android.content.res.ColorStateList. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setClickable(boolean)(boolean clickable)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setContentPadding(int,int,int,int)(int left, int top, int right, int bottom)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setDragged(boolean)(boolean dragged)` Call this when the Card is being dragged to apply the right color and elevation changes. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setMaxCardElevation(float)(float maxCardElevation)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setOnCheckedChangeListener(com.google.android.material.card.MaterialCardView.OnCheckedChangeListener)( https://developer.android.com/reference/com/google/android/material/card/MaterialCardView.OnCheckedChangeListener listener )` Register a callback to be invoked when the checked state of this Card changes. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setPreventCornerOverlap(boolean)(boolean preventCornerOverlap)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setProgress(float)(float progress)` Sets the interpolation on the Shape Path of the card. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setRadius(float)(float radius)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setRippleColor(ColorStateList)(ColorStateList rippleColor)` Sets the ripple color for this card. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setRippleColorResource(int)(int rippleColorResourceId)` Sets the ripple color resource for this card. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)(https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel shapeAppearanceModel)` Sets the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` that defines the shape. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setStrokeColor(ColorStateList)(ColorStateList strokeColor)` Sets the stroke color of this card view. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setStrokeColor(int)(int strokeColor)` Sets the stroke color of this card view. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setStrokeWidth(int)(int strokeWidth)` Sets the stroke width of this card view. | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#setUseCompatPadding(boolean)(boolean useCompatPadding)` | | `void` | `https://developer.android.com/reference/com/google/android/material/card/MaterialCardView#toggle()()` | |

## Public constructors

### CircularRevealCardView

```
public CircularRevealCardView(Context context)
```

### CircularRevealCardView

```
public CircularRevealCardView(Context context, AttributeSet attrs)
```

## Public methods

### actualDraw

```
public void actualDraw(Canvas canvas)
```

Calls super#draw(Canvas).

The delegate should override draw to call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper` if the helper is non-null.

### actualIsOpaque

```
public boolean actualIsOpaque()
```

Calls super#isOpaque().

The delegate should override isOpaque to call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper` if the helper is non-null.

### buildCircularRevealCache

```
public void buildCircularRevealCache()
```

Prepares the reveal info property to be modified. See the interface javadoc for usage details.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### destroyCircularRevealCache

```
public void destroyCircularRevealCache()
```

Cleans up after the reveal info property is reset. See the interface javadoc for usage details.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### draw

```
public void draw(Canvas canvas)
```

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### getCircularRevealOverlayDrawable

```
public Drawable getCircularRevealOverlayDrawable()
```

Returns the circular reveal overlay drawable if one exists, or null.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### getCircularRevealScrimColor

```
public int getCircularRevealScrimColor()
```

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### getRevealInfo

```
public CircularRevealWidget.RevealInfo getRevealInfo()
```

Returns the current reveal info if one exists, or null. The radius of the reveal info will never be greater than the distance to the furthest corner.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### isOpaque

```
public boolean isOpaque()
```

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### setCircularRevealOverlayDrawable

```
public void setCircularRevealOverlayDrawable(Drawable drawable)
```

Sets the circular reveal overlay drawable, which is an icon that's drawn above everything else, including the circular reveal scrim color.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### setCircularRevealScrimColor

```
public void setCircularRevealScrimColor(int color)
```

Sets the circular reveal scrim color, which is a color that's drawn above this widget's contents.

Because the scrim makes no assumptions about the shape of the view's background and content, callers should ensure that the scrim is only visible when the circular reveal does not yet extend to the edges of the view.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.

### setRevealInfo

```
public void setRevealInfo(CircularRevealWidget.RevealInfo revealInfo)
```

Sets the current reveal info. Care should be taken to call `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealWidget#buildCircularRevealCache()` and `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealWidget#destroyCircularRevealCache()` appropriately. See the interface javadoc for usage details.

Note that on L+, calling this method doesn't result in any visual changes. You must use this with ViewAnimationUtils.

Implementations should call the corresponding method in `https://developer.android.com/reference/com/google/android/material/circularreveal/CircularRevealHelper`.