CircularRevealHelper

public class 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 Delegate.

Summary

Nested types

Delegate interface to be implemented by the CircularRevealWidget that owns this helper.

@Retention(value = RetentionPolicy.SOURCE)
public annotation CircularRevealHelper.Strategy

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

Constants

static final int

Specify that this view should use a BitmapShader to create the circular reveal effect.

static final int

Specify that this view should use clipPath to create the circular reveal effect.

static final int

Specify that this view should use createCircularReveal to create the circular reveal effect.

static final int

Public fields

CircularRevealWidget.RevealInfo

The circular reveal representation which affects how the current frame will be drawn.

Public constructors

Public methods

void
void
void
draw(Canvas canvas)
Drawable
int
CircularRevealWidget.RevealInfo
boolean
void
void
void

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.

Constants

BITMAP_SHADER

public static final int BITMAP_SHADER = 0

Specify that this view should use a BitmapShader to create the circular reveal effect. The downside that it can only animate a static Bitmap.

CLIP_PATH

public static final int CLIP_PATH = 1

Specify that this view should use clipPath to create the circular reveal effect.

REVEAL_ANIMATOR

public static final int REVEAL_ANIMATOR = 2

Specify that this view should use createCircularReveal to create the circular reveal effect.

STRATEGY

@CircularRevealHelper.Strategy
public static final int STRATEGY = 2

Public fields

revealInfo

public CircularRevealWidget.RevealInfo revealInfo

The circular reveal representation which affects how the current frame will be drawn.

A non-null RevealInfo is invalid if a circular reveal is active and the circular reveal does not cover all four corners of this view. When the circular reveal is such that it covers the entire view, radius should be set to INVALID_RADIUS, making the RevealInfo invalid. An invalid RevealInfo is a optimization that allows draw to use the fastest code path.

Public constructors

CircularRevealHelper

public CircularRevealHelper(CircularRevealHelper.Delegate delegate)

Public methods

buildCircularRevealCache

public void buildCircularRevealCache()

destroyCircularRevealCache

public void destroyCircularRevealCache()

draw

public void draw(Canvas canvas)

getCircularRevealOverlayDrawable

public Drawable getCircularRevealOverlayDrawable()

getCircularRevealScrimColor

public int getCircularRevealScrimColor()

isOpaque

public boolean isOpaque()

setCircularRevealOverlayDrawable

public void setCircularRevealOverlayDrawable(Drawable drawable)

setCircularRevealScrimColor

public void setCircularRevealScrimColor(int color)

setRevealInfo

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