CircularRevealCardView

public class CircularRevealCardView extends MaterialCardView implements CircularRevealWidget


A CircularRevealWidget wrapper for MaterialCardView.

Summary

Public constructors

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

Public methods

void
actualDraw(Canvas canvas)

Calls super#draw(Canvas).

boolean

Calls super#isOpaque().

void

Prepares the reveal info property to be modified.

void

Cleans up after the reveal info property is reset.

void
draw(Canvas canvas)

Implementations should call the corresponding method in CircularRevealHelper.

Drawable

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

int

Implementations should call the corresponding method in CircularRevealHelper.

CircularRevealWidget.RevealInfo

Returns the current reveal info if one exists, or null.

boolean

Implementations should call the corresponding method in CircularRevealHelper.

void

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

void

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

void

Sets the current reveal info.

Inherited Constants

From com.google.android.material.card.MaterialCardView
static final int

Gravity used to position the checked icon at the bottom|end of the Card.

static final int

Gravity used to position the checked icon at the bottom|start of the Card.

static final int

Gravity used to position the checked icon at the top|end of the Card.

static final int

Gravity used to position the checked icon at the top|start of the Card.

Inherited methods

From com.google.android.material.card.MaterialCardView
ColorStateList
ColorStateList

Sets the ripple color for this card.

Drawable

Returns this cards's checked icon.

int

Gets the checked icon gravity for this card

int
int
ColorStateList

Returns the android.content.res.ColorStateList used to tint the checked icon.

int
int
int
int
float

Returns the interpolation on the Shape Path of the card.

float
ColorStateList

Gets the ripple color for this card.

ShapeAppearanceModel

Due to limitations in the current implementation, if you modify the returned object call setShapeAppearanceModel again with the modified value to propagate the required changes.

int

This method is deprecated.

use getStrokeColorStateList

ColorStateList

Returns the stroke ColorStateList of this card view.

int

Returns the stroke width of this card view.

boolean

Returns whether this Card is checkable.

boolean
boolean
void
int[]
onCreateDrawableState(int extraSpace)
void
onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent)
void
onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
void
onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void
setBackground(Drawable drawable)
void
setBackgroundDrawable(Drawable drawable)
void
setCardBackgroundColor(ColorStateList color)
void
void
setCardElevation(float elevation)
void
setCardForegroundColor(ColorStateList foregroundColor)

Sets the foreground color for this card.

void
setCheckable(boolean checkable)

Sets whether this Card is checkable.

void
setChecked(boolean checked)
void
setCheckedIcon(Drawable checkedIcon)

Sets this card's checked icon.

void

Sets the checked icon gravity for this card

void
setCheckedIconMargin(int checkedIconMargin)
void
setCheckedIconMarginResource(int checkedIconMarginResId)

Sets the margin of the checked icon using a resource id.

void

Sets this card's checked icon using a resource id.

void
setCheckedIconSize(int checkedIconSize)

Sets the size of the checked icon

void
setCheckedIconSizeResource(int checkedIconSizeResId)

Sets the size of the checked icon using a resource id.

void
setCheckedIconTint(ColorStateList checkedIconTint)

Sets this checked icon color tint using the specified .

void
setClickable(boolean clickable)
void
setContentPadding(int left, int top, int right, int bottom)
void
setDragged(boolean dragged)

Call this when the Card is being dragged to apply the right color and elevation changes.

void
setMaxCardElevation(float maxCardElevation)
void

Register a callback to be invoked when the checked state of this Card changes.

void
setPreventCornerOverlap(boolean preventCornerOverlap)
void
setProgress(float progress)

Sets the interpolation on the Shape Path of the card.

void
setRadius(float radius)
void
setRippleColor(ColorStateList rippleColor)

Sets the ripple color for this card.

void
setRippleColorResource(int rippleColorResourceId)

Sets the ripple color resource for this card.

void

Sets the ShapeAppearanceModel that defines the shape.

void
setStrokeColor(ColorStateList strokeColor)

Sets the stroke color of this card view.

void
setStrokeColor(int strokeColor)

Sets the stroke color of this card view.

void
setStrokeWidth(int strokeWidth)

Sets the stroke width of this card view.

void
setUseCompatPadding(boolean useCompatPadding)
void

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 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 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 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 CircularRevealHelper.

draw

public void draw(Canvas canvas)

Implementations should call the corresponding method in CircularRevealHelper.

getCircularRevealOverlayDrawable

public Drawable getCircularRevealOverlayDrawable()

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

Implementations should call the corresponding method in CircularRevealHelper.

getCircularRevealScrimColor

public int getCircularRevealScrimColor()

Implementations should call the corresponding method in 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 CircularRevealHelper.

isOpaque

public boolean isOpaque()

Implementations should call the corresponding method in 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 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 CircularRevealHelper.

setRevealInfo

public void setRevealInfo(CircularRevealWidget.RevealInfo revealInfo)

Sets the current reveal info. Care should be taken to call buildCircularRevealCache and 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 CircularRevealHelper.