CircularRevealWidget
public
interface
CircularRevealWidget
implements
CircularRevealHelper.Delegate
com.google.android.material.circularreveal.CircularRevealWidget |
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, useCircularRevealCompat
. To modify the scrim color, use CircularRevealWidget.CircularRevealScrimColorProperty
.
Implementation
To support circular reveal for an arbitrary view, create a subclass of that view that implements theCircularRevealWidget
interface. The subclass should instantiate a CircularRevealHelper
and pass itself into the helper's constructor.
All unimplemented methods should be implemented as directed in the javadoc.
Only View
s should implement this interface. Callers may expect an instance of this
interface to be a View
.
Summary
Nested classes | |
---|---|
class |
CircularRevealWidget.CircularRevealEvaluator
A |
class |
CircularRevealWidget.CircularRevealProperty
A Property wrapper around the compound |
class |
CircularRevealWidget.CircularRevealScrimColorProperty
A Property wrapper around the |
class |
CircularRevealWidget.RevealInfo
RevealInfo holds three values for a circular reveal. |
Public methods | |
---|---|
abstract
void
|
buildCircularRevealCache()
Prepares the |
abstract
void
|
destroyCircularRevealCache()
Cleans up after the |
abstract
void
|
draw(Canvas canvas)
Implementations should call the corresponding method in |
abstract
Drawable
|
getCircularRevealOverlayDrawable()
Returns the |
abstract
int
|
getCircularRevealScrimColor()
Implementations should call the corresponding method in |
abstract
CircularRevealWidget.RevealInfo
|
getRevealInfo()
Returns the current |
abstract
boolean
|
isOpaque()
Implementations should call the corresponding method in |
abstract
void
|
setCircularRevealOverlayDrawable(Drawable drawable)
Sets the |
abstract
void
|
setCircularRevealScrimColor(int color)
Sets the |
abstract
void
|
setRevealInfo(CircularRevealWidget.RevealInfo revealInfo)
Sets the current |
Inherited methods | |
---|---|
Public methods
buildCircularRevealCache
public abstract void buildCircularRevealCache ()
Prepares the
Implementations should call the corresponding method in CircularRevealHelper
.
destroyCircularRevealCache
public abstract void destroyCircularRevealCache ()
Cleans up after the
Implementations should call the corresponding method in CircularRevealHelper
.
draw
public abstract void draw (Canvas canvas)
Implementations should call the corresponding method in CircularRevealHelper
.
Parameters | |
---|---|
canvas |
Canvas |
getCircularRevealOverlayDrawable
public abstract Drawable getCircularRevealOverlayDrawable ()
Returns the
Implementations should call the corresponding method in CircularRevealHelper
.
Returns | |
---|---|
Drawable |
getCircularRevealScrimColor
public abstract int getCircularRevealScrimColor ()
Implementations should call the corresponding method in CircularRevealHelper
.
Returns | |
---|---|
int |
getRevealInfo
public abstract CircularRevealWidget.RevealInfo getRevealInfo ()
Returns the current
Implementations should call the corresponding method in CircularRevealHelper
.
Returns | |
---|---|
CircularRevealWidget.RevealInfo |
isOpaque
public abstract boolean isOpaque ()
Implementations should call the corresponding method in CircularRevealHelper
.
Returns | |
---|---|
boolean |
setCircularRevealOverlayDrawable
public abstract void setCircularRevealOverlayDrawable (Drawable drawable)
Sets the
Implementations should call the corresponding method in CircularRevealHelper
.
Parameters | |
---|---|
drawable |
Drawable |
setCircularRevealScrimColor
public abstract void setCircularRevealScrimColor (int color)
Sets the
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 abstract void setRevealInfo (CircularRevealWidget.RevealInfo revealInfo)
Sets the current 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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-02-08 UTC.