android.support.wearable.view
Class CrossfadeDrawable

java.lang.Object
  extended by Drawable
      extended by android.support.wearable.view.CrossfadeDrawable

public class CrossfadeDrawable
extends Drawable

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.

See Also:
setBase(Drawable), setFading(Drawable), setProgress(float)

Constructor Summary
CrossfadeDrawable()
           
 
Method Summary
 void clearColorFilter()
           
 void draw(Canvas canvas)
           
 int getAlpha()
           
 int getChangingConfigurations()
           
 int getIntrinsicHeight()
           
 int getIntrinsicWidth()
           
 int getOpacity()
           
 void invalidateDrawable(Drawable who)
           
 boolean isStateful()
           
 void jumpToCurrentState()
           
protected  void onBoundsChange(Rect bounds)
           
protected  boolean onLevelChange(int level)
           
protected  boolean onStateChange(int[] state)
           
 void scheduleDrawable(Drawable who, java.lang.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, 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, java.lang.Runnable what)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrossfadeDrawable

public CrossfadeDrawable()
Method Detail

setFading

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


setBase

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


setProgress

public void setProgress(float progress)

draw

public void draw(Canvas canvas)

getIntrinsicWidth

public int getIntrinsicWidth()

getIntrinsicHeight

public int getIntrinsicHeight()

onBoundsChange

protected void onBoundsChange(Rect bounds)

jumpToCurrentState

public void jumpToCurrentState()

setChangingConfigurations

public void setChangingConfigurations(int configs)

setFilterBitmap

public void setFilterBitmap(boolean filter)

setDither

public void setDither(boolean dither)

setColorFilter

public void setColorFilter(ColorFilter cf)

setColorFilter

public void setColorFilter(int color,
                           Mode mode)

clearColorFilter

public void clearColorFilter()

getChangingConfigurations

public int getChangingConfigurations()

onStateChange

protected boolean onStateChange(int[] state)

onLevelChange

protected boolean onLevelChange(int level)

isStateful

public boolean isStateful()

getAlpha

public int getAlpha()

setAlpha

public void setAlpha(int alpha)

getOpacity

public int getOpacity()

invalidateDrawable

public void invalidateDrawable(Drawable who)

scheduleDrawable

public void scheduleDrawable(Drawable who,
                             java.lang.Runnable what,
                             long when)

unscheduleDrawable

public void unscheduleDrawable(Drawable who,
                               java.lang.Runnable what)