CircularRevealHelper

public class CircularRevealHelper
extends Object

java.lang.Object
   ↳ com.google.android.material.circularreveal.CircularRevealHelper


Helper class to implement circular reveal functionality.

A CircularRevealWidget subclass will call the corresponding method in this helper, which contains the actual implementations for circular reveal. This helper communicates back to the widget via the ERROR(/#delegate).

Summary

Nested classes

@interface CircularRevealHelper.Strategy

Which strategy this view should use to create the circular reveal effect. 

Constants

int BITMAP_SHADER

Specify that this view should use a ERROR(/BitmapShader) to create the circular reveal effect.

int CLIP_PATH

Specify that this view should use ERROR(/Canvas#clipPath(Path)) to create the circular reveal effect.

int REVEAL_ANIMATOR

Specify that this view should use createCircularReveal(View, int, int, float, float) to create the circular reveal effect.

Fields

public static final int STRATEGY

Public constructors

CircularRevealHelper(CircularRevealHelper.Delegate delegate)

Public methods

void buildCircularRevealCache()
void destroyCircularRevealCache()
void draw(Canvas canvas)
Drawable getCircularRevealOverlayDrawable()
int getCircularRevealScrimColor()
CircularRevealWidget.RevealInfo getRevealInfo()
boolean isOpaque()
void setCircularRevealOverlayDrawable(Drawable drawable)
void setCircularRevealScrimColor(int color)
void setRevealInfo(CircularRevealWidget.RevealInfo revealInfo)

Sets the reveal info, ensuring that a reveal circle with a large enough radius that covers the entire View has its radius set to INVALID_RADIUS.

Inherited methods

From class java.lang.Object

Constants

BITMAP_SHADER

int BITMAP_SHADER

Specify that this view should use a ERROR(/BitmapShader) to create the circular reveal effect. BitmapShader is supported in all APIs, but has the downside that it can only animate a static ERROR(/Bitmap).

Constant Value: 0 (0x00000000)

CLIP_PATH

int CLIP_PATH

Specify that this view should use ERROR(/Canvas#clipPath(Path)) to create the circular reveal effect. clipPath() is only hardware accelerated on ERROR(/VERSION_CODES#JELLY_BEAN_MR2) and above.

Constant Value: 1 (0x00000001)

REVEAL_ANIMATOR

int REVEAL_ANIMATOR

Specify that this view should use createCircularReveal(View, int, int, float, float) to create the circular reveal effect. This is only supported on ERROR(/VERSION_CODES#LOLLIPOP) and above.

Constant Value: 2 (0x00000002)

Fields

STRATEGY

int STRATEGY

Public constructors

CircularRevealHelper

CircularRevealHelper (CircularRevealHelper.Delegate delegate)

Parameters
delegate CircularRevealHelper.Delegate

Public methods

buildCircularRevealCache

void buildCircularRevealCache ()

destroyCircularRevealCache

void destroyCircularRevealCache ()

draw

void draw (Canvas canvas)

Parameters
canvas Canvas

getCircularRevealOverlayDrawable

Drawable getCircularRevealOverlayDrawable ()

Returns
Drawable

getCircularRevealScrimColor

int getCircularRevealScrimColor ()

Returns
int

getRevealInfo

CircularRevealWidget.RevealInfo getRevealInfo ()

Returns
CircularRevealWidget.RevealInfo

isOpaque

boolean isOpaque ()

Returns
boolean

setCircularRevealOverlayDrawable

void setCircularRevealOverlayDrawable (Drawable drawable)

Parameters
drawable Drawable

setCircularRevealScrimColor

void setCircularRevealScrimColor (int color)

Parameters
color int

setRevealInfo

void setRevealInfo (CircularRevealWidget.RevealInfo revealInfo)

Sets the reveal info, ensuring that a reveal circle with a large enough radius that covers the entire View has its radius set to INVALID_RADIUS.

Parameters
revealInfo CircularRevealWidget.RevealInfo