RippleDrawableCompat
public
class
RippleDrawableCompat
extends Drawable
implements
Shapeable,
TintAwareDrawable
java.lang.Object
|
↳ |
android.graphics.drawable.Drawable
|
|
↳ |
com.google.android.material.ripple.RippleDrawableCompat
|
A compat Drawable
that is used to provide an overlay for pressed, focused, and hovered
states (only when in enabled). This is intended to be used pre-Lollipop.
This Drawable is a MaterialShapeDrawable
so that it can be shaped to match a
MaterialShapeDrawable background.
Unlike the framework RippleDrawable
, this will not
apply different alphas for pressed, focused, and hovered states and it does not provide a ripple
animation for the pressed state.
Summary
Inherited methods |
From class
android.graphics.drawable.Drawable
void
|
applyTheme(Resources.Theme arg0)
|
boolean
|
canApplyTheme()
|
void
|
clearColorFilter()
|
final
Rect
|
copyBounds()
|
final
void
|
copyBounds(Rect arg0)
|
static
Drawable
|
createFromPath(String arg0)
|
static
Drawable
|
createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3, BitmapFactory.Options arg4)
|
static
Drawable
|
createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3)
|
static
Drawable
|
createFromStream(InputStream arg0, String arg1)
|
static
Drawable
|
createFromXml(Resources arg0, XmlPullParser arg1)
|
static
Drawable
|
createFromXml(Resources arg0, XmlPullParser arg1, Resources.Theme arg2)
|
static
Drawable
|
createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3)
|
static
Drawable
|
createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2)
|
abstract
void
|
draw(Canvas arg0)
|
int
|
getAlpha()
|
final
Rect
|
getBounds()
|
Drawable.Callback
|
getCallback()
|
int
|
getChangingConfigurations()
|
ColorFilter
|
getColorFilter()
|
Drawable.ConstantState
|
getConstantState()
|
Drawable
|
getCurrent()
|
Rect
|
getDirtyBounds()
|
void
|
getHotspotBounds(Rect arg0)
|
int
|
getIntrinsicHeight()
|
int
|
getIntrinsicWidth()
|
int
|
getLayoutDirection()
|
final
int
|
getLevel()
|
int
|
getMinimumHeight()
|
int
|
getMinimumWidth()
|
abstract
int
|
getOpacity()
|
Insets
|
getOpticalInsets()
|
void
|
getOutline(Outline arg0)
|
boolean
|
getPadding(Rect arg0)
|
int[]
|
getState()
|
Region
|
getTransparentRegion()
|
boolean
|
hasFocusStateSpecified()
|
void
|
inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3)
|
void
|
inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2)
|
void
|
invalidateSelf()
|
boolean
|
isAutoMirrored()
|
boolean
|
isFilterBitmap()
|
boolean
|
isProjected()
|
boolean
|
isStateful()
|
final
boolean
|
isVisible()
|
void
|
jumpToCurrentState()
|
Drawable
|
mutate()
|
void
|
onBoundsChange(Rect arg0)
|
boolean
|
onLayoutDirectionChanged(int arg0)
|
boolean
|
onLevelChange(int arg0)
|
boolean
|
onStateChange(int[] arg0)
|
static
int
|
resolveOpacity(int arg0, int arg1)
|
void
|
scheduleSelf(Runnable arg0, long arg1)
|
abstract
void
|
setAlpha(int arg0)
|
void
|
setAutoMirrored(boolean arg0)
|
void
|
setBounds(int arg0, int arg1, int arg2, int arg3)
|
void
|
setBounds(Rect arg0)
|
final
void
|
setCallback(Drawable.Callback arg0)
|
void
|
setChangingConfigurations(int arg0)
|
void
|
setColorFilter(int arg0, PorterDuff.Mode arg1)
|
abstract
void
|
setColorFilter(ColorFilter arg0)
|
void
|
setDither(boolean arg0)
|
void
|
setFilterBitmap(boolean arg0)
|
void
|
setHotspot(float arg0, float arg1)
|
void
|
setHotspotBounds(int arg0, int arg1, int arg2, int arg3)
|
final
boolean
|
setLayoutDirection(int arg0)
|
final
boolean
|
setLevel(int arg0)
|
boolean
|
setState(int[] arg0)
|
void
|
setTint(int arg0)
|
void
|
setTintBlendMode(BlendMode arg0)
|
void
|
setTintList(ColorStateList arg0)
|
void
|
setTintMode(PorterDuff.Mode arg0)
|
boolean
|
setVisible(boolean arg0, boolean arg1)
|
void
|
unscheduleSelf(Runnable arg0)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
|
From interface
androidx.core.graphics.drawable.TintAwareDrawable
abstract
void
|
setTint(int arg0)
|
abstract
void
|
setTintList(ColorStateList arg0)
|
abstract
void
|
setTintMode(PorterDuff.Mode arg0)
|
|
Public constructors
RippleDrawableCompat
public RippleDrawableCompat (ShapeAppearanceModel shapeAppearanceModel)
Creates a RippleDrawableCompat
with the given shape that will only draw when enabled
and at least one of: pressed, focused, or hovered.
Parameters |
shapeAppearanceModel |
ShapeAppearanceModel : The shape for the ripple.
|
Public methods
draw
public void draw (Canvas canvas)
getConstantState
public Drawable.ConstantState getConstantState ()
Returns |
Drawable.ConstantState |
|
getOpacity
public int getOpacity ()
isStateful
public boolean isStateful ()
setAlpha
public void setAlpha (int alpha)
setColorFilter
public void setColorFilter (ColorFilter colorFilter)
Parameters |
colorFilter |
ColorFilter |
setShapeAppearanceModel
public void setShapeAppearanceModel (ShapeAppearanceModel shapeAppearanceModel)
Sets the ShapeAppearanceModel
that defines the shape.
Parameters |
shapeAppearanceModel |
ShapeAppearanceModel |
setTint
public void setTint (int tintColor)
setTintList
public void setTintList (ColorStateList tintList)
Parameters |
tintList |
ColorStateList |
setTintMode
public void setTintMode (PorterDuff.Mode tintMode)
Parameters |
tintMode |
PorterDuff.Mode |
Protected methods
onBoundsChange
protected void onBoundsChange (Rect bounds)
onStateChange
protected boolean onStateChange (int[] stateSet)