Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

CircularRevealCardView

public class CircularRevealCardView
extends MaterialCardView implements CircularRevealWidget

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ androidx.cardview.widget.CardView
           ↳ com.google.android.material.card.MaterialCardView
             ↳ com.google.android.material.circularreveal.cardview.CircularRevealCardView


A CircularRevealWidget wrapper for MaterialCardView.

Summary

Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

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

Public methods

void actualDraw(Canvas canvas)

Calls super#draw(Canvas).

boolean actualIsOpaque()

Calls super#isOpaque().

void buildCircularRevealCache()

Prepares the reveal info property to be modified.

void destroyCircularRevealCache()

Cleans up after the reveal info property is reset.

void draw(Canvas canvas)
Drawable getCircularRevealOverlayDrawable()

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

int getCircularRevealScrimColor()

Implementations should call the corresponding method in CircularRevealHelper.

CircularRevealWidget.RevealInfo getRevealInfo()

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

boolean isOpaque()
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.

void setCircularRevealScrimColor(int color)

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

void setRevealInfo(CircularRevealWidget.RevealInfo revealInfo)

Sets the current reveal info.

Inherited methods

Public constructors

CircularRevealCardView

public CircularRevealCardView (Context context)

Parameters
context Context

CircularRevealCardView

public CircularRevealCardView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Public methods

actualDraw

public void actualDraw (Canvas canvas)

Calls super#draw(Canvas).

The delegate should override View.draw(Canvas) to call the corresponding method in CircularRevealHelper if the helper is non-null.

Parameters
canvas Canvas

actualIsOpaque

public boolean actualIsOpaque ()

Calls super#isOpaque().

The delegate should override View.isOpaque() to call the corresponding method in CircularRevealHelper if the helper is non-null.

Returns
boolean

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)

Parameters
canvas Canvas

getCircularRevealOverlayDrawable

public Drawable getCircularRevealOverlayDrawable ()

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

Implementations should call the corresponding method in CircularRevealHelper.

Returns
Drawable

getCircularRevealScrimColor

public int getCircularRevealScrimColor ()

Implementations should call the corresponding method in CircularRevealHelper.

Returns
int

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.

Returns
CircularRevealWidget.RevealInfo

isOpaque

public boolean isOpaque ()

Returns
boolean

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.

Parameters
drawable Drawable

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.

Parameters
color int

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.

Parameters
revealInfo CircularRevealWidget.RevealInfo