CrossfadeDrawable

public class CrossfadeDrawable
extends Drawable implements Drawable.Callback

java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ android.support.wearable.view.CrossfadeDrawable


This class is deprecated.
consider using AnimationSet instead.

Contains two child drawables and provides methods to directly adjust the blend between the two.

The base layer is always painted fully opaque, and the fading layer is adjusted according to the current progress value.

Summary

Public constructors

CrossfadeDrawable()

Public methods

void clearColorFilter()
void draw(Canvas canvas)
int getAlpha()
Drawable getBase()
int getChangingConfigurations()
Drawable getFading()
int getIntrinsicHeight()
int getIntrinsicWidth()
int getOpacity()
void invalidateDrawable(Drawable who)
boolean isStateful()
void jumpToCurrentState()
void scheduleDrawable(Drawable who, Runnable what, long when)
void setAlpha(int alpha)
void setBase(Drawable d)

Sets the image for the base layer.

void setChangingConfigurations(int configs)
void setColorFilter(ColorFilter cf)
void setColorFilter(int color, PorterDuff.Mode mode)
void setDither(boolean dither)
void setFading(Drawable d)

Sets the image for the fading layer.

void setFilterBitmap(boolean filter)
void setProgress(float progress)
void unscheduleDrawable(Drawable who, Runnable what)

Protected methods

void onBoundsChange(Rect bounds)
boolean onLevelChange(int level)
boolean onStateChange(int[] state)

Inherited methods

From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback

Public constructors

CrossfadeDrawable

CrossfadeDrawable ()

Public methods

clearColorFilter

void clearColorFilter ()

draw

void draw (Canvas canvas)

Parameters
canvas Canvas

getAlpha

int getAlpha ()

Returns
int

getBase

Drawable getBase ()

Returns
Drawable

getChangingConfigurations

int getChangingConfigurations ()

Returns
int

getFading

Drawable getFading ()

Returns
Drawable

getIntrinsicHeight

int getIntrinsicHeight ()

Returns
int

getIntrinsicWidth

int getIntrinsicWidth ()

Returns
int

getOpacity

int getOpacity ()

Returns
int

invalidateDrawable

void invalidateDrawable (Drawable who)

Parameters
who Drawable

isStateful

boolean isStateful ()

Returns
boolean

jumpToCurrentState

void jumpToCurrentState ()

scheduleDrawable

void scheduleDrawable (Drawable who, 
                Runnable what, 
                long when)

Parameters
who Drawable

what Runnable

when long

setAlpha

void setAlpha (int alpha)

Parameters
alpha int

setBase

void setBase (Drawable d)

Sets the image for the base layer. This drawable's opacity remains fixed. It's fully visible when progress == 0, and completely obscured when progress == 1.

Parameters
d Drawable

setChangingConfigurations

void setChangingConfigurations (int configs)

Parameters
configs int

setColorFilter

void setColorFilter (ColorFilter cf)

Parameters
cf ColorFilter

setColorFilter

void setColorFilter (int color, 
                PorterDuff.Mode mode)

Parameters
color int

mode PorterDuff.Mode

setDither

void setDither (boolean dither)

Parameters
dither boolean

setFading

void setFading (Drawable d)

Sets the image for the fading layer. This drawable's opacity will vary directly proportionally to the progress value. It's invisible when progress == 0 and fully opaque when progress == 1.

Parameters
d Drawable

setFilterBitmap

void setFilterBitmap (boolean filter)

Parameters
filter boolean

setProgress

void setProgress (float progress)

Parameters
progress float

unscheduleDrawable

void unscheduleDrawable (Drawable who, 
                Runnable what)

Parameters
who Drawable

what Runnable

Protected methods

onBoundsChange

void onBoundsChange (Rect bounds)

Parameters
bounds Rect

onLevelChange

boolean onLevelChange (int level)

Parameters
level int

Returns
boolean

onStateChange

boolean onStateChange (int[] state)

Parameters
state int

Returns
boolean