CircularRevealWidget

public interface CircularRevealWidget extends CircularRevealHelper.Delegate

Known direct subclasses
CircularRevealCardView

A CircularRevealWidget wrapper for MaterialCardView.

CircularRevealCoordinatorLayout

A CircularRevealWidget wrapper for CoordinatorLayout.

CircularRevealFrameLayout

A CircularRevealWidget wrapper for FrameLayout.

CircularRevealGridLayout

A CircularRevealWidget wrapper for GridLayout.

CircularRevealLinearLayout

A CircularRevealWidget wrapper for LinearLayout.

CircularRevealRelativeLayout

A CircularRevealWidget wrapper for RelativeLayout.


Interface which denotes that a View supports a circular clip and scrim color, even for pre-L APIs.

Usage

You should not have to interact with instances of this interface directly. To modify the circular clip, use CircularRevealCompat. To modify the scrim color, use .

Implementation

To support circular reveal for an arbitrary view, create a subclass of that view that implements the CircularRevealWidget interface. The subclass should instantiate a and pass itself into the helper's constructor.

All unimplemented methods should be implemented as directed in the javadoc.

Only Views should implement this interface. Callers may expect an instance of this interface to be a View.

Summary

Nested types

A TypeEvaluator that performs type interpolation between two RevealInfos.

A Property wrapper around the compound circularReveal functionality on a .

A Property wrapper around the circularRevealScrimColor functionality on a .

RevealInfo holds three values for a circular reveal.

Public methods

abstract void

Prepares the reveal info property to be modified.

abstract void

Cleans up after the reveal info property is reset.

abstract void
draw(Canvas canvas)

Implementations should call the corresponding method in CircularRevealHelper.

abstract Drawable

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

abstract int

Implementations should call the corresponding method in CircularRevealHelper.

abstract CircularRevealWidget.RevealInfo

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

abstract boolean

Implementations should call the corresponding method in CircularRevealHelper.

abstract void

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

abstract void

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

abstract void

Sets the current reveal info.

Inherited methods

From com.google.android.material.circularreveal.CircularRevealHelper.Delegate
abstract void
actualDraw(Canvas canvas)

Calls super#draw(Canvas).

abstract boolean

Calls super#isOpaque().

Public methods

buildCircularRevealCache

abstract 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

abstract 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

abstract void draw(Canvas canvas)

Implementations should call the corresponding method in CircularRevealHelper.

getCircularRevealOverlayDrawable

abstract Drawable getCircularRevealOverlayDrawable()

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

Implementations should call the corresponding method in CircularRevealHelper.

getCircularRevealScrimColor

abstract int getCircularRevealScrimColor()

Implementations should call the corresponding method in CircularRevealHelper.

getRevealInfo

abstract 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

abstract boolean isOpaque()

Implementations should call the corresponding method in CircularRevealHelper.

setCircularRevealOverlayDrawable

abstract 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

abstract 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

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