android.graphics.drawable
Class LayerDrawable

java.lang.Object
  extended by android.graphics.drawable.Drawable
      extended by android.graphics.drawable.LayerDrawable
All Implemented Interfaces:
Drawable.Callback
Direct Known Subclasses:
TransitionDrawable

public class LayerDrawable
extends Drawable
implements Drawable.Callback


Nested Class Summary
 
Nested classes/interfaces inherited from class android.graphics.drawable.Drawable
Drawable.Callback, Drawable.ConstantState
 
Constructor Summary
LayerDrawable(Drawable[] layers)
           
 
Method Summary
 void draw(Canvas canvas)
           
 Drawable findDrawableByLayerId(int id)
           
 int getChangingConfigurations()
           
 Drawable.ConstantState getConstantState()
           
 Drawable getDrawable(int index)
           
 int getId(int index)
           
 int getIntrinsicHeight()
           
 int getIntrinsicWidth()
           
 int getNumberOfLayers()
           
 int getOpacity()
           
 boolean getPadding(Rect padding)
           
 void inflate(Resources r, org.xmlpull.v1.XmlPullParser parser, AttributeSet attrs)
           
 void invalidateDrawable(Drawable who)
           
 boolean isStateful()
           
 Drawable mutate()
           
protected  void onBoundsChange(Rect bounds)
           
protected  boolean onLevelChange(int level)
           
protected  boolean onStateChange(int[] state)
           
 void scheduleDrawable(Drawable who, Runnable what, long when)
           
 void setAlpha(int alpha)
           
 void setColorFilter(ColorFilter cf)
           
 void setDither(boolean dither)
           
 boolean setDrawableByLayerId(int id, Drawable drawable)
           
 void setId(int index, int id)
           
 void setLayerInset(int index, int l, int t, int r, int b)
           
 void setOpacity(int opacity)
           
 boolean setVisible(boolean visible, boolean restart)
           
 void unscheduleDrawable(Drawable who, Runnable what)
           
 
Methods inherited from class android.graphics.drawable.Drawable
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXmlInner, getBounds, getCallback, getCurrent, getLevel, getMinimumHeight, getMinimumWidth, getState, getTransparentRegion, invalidateSelf, isVisible, jumpToCurrentState, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setFilterBitmap, setLevel, setState, unscheduleSelf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerDrawable

public LayerDrawable(Drawable[] layers)
Method Detail

inflate

public void inflate(Resources r,
                    org.xmlpull.v1.XmlPullParser parser,
                    AttributeSet attrs)
             throws org.xmlpull.v1.XmlPullParserException,
                    IOException
Overrides:
inflate in class Drawable
Throws:
org.xmlpull.v1.XmlPullParserException
IOException

findDrawableByLayerId

public Drawable findDrawableByLayerId(int id)

setId

public void setId(int index,
                  int id)

getNumberOfLayers

public int getNumberOfLayers()

getDrawable

public Drawable getDrawable(int index)

getId

public int getId(int index)

setDrawableByLayerId

public boolean setDrawableByLayerId(int id,
                                    Drawable drawable)

setLayerInset

public void setLayerInset(int index,
                          int l,
                          int t,
                          int r,
                          int b)

invalidateDrawable

public void invalidateDrawable(Drawable who)
Specified by:
invalidateDrawable in interface Drawable.Callback

scheduleDrawable

public void scheduleDrawable(Drawable who,
                             Runnable what,
                             long when)
Specified by:
scheduleDrawable in interface Drawable.Callback

unscheduleDrawable

public void unscheduleDrawable(Drawable who,
                               Runnable what)
Specified by:
unscheduleDrawable in interface Drawable.Callback

draw

public void draw(Canvas canvas)
Specified by:
draw in class Drawable

getChangingConfigurations

public int getChangingConfigurations()
Overrides:
getChangingConfigurations in class Drawable

getPadding

public boolean getPadding(Rect padding)
Overrides:
getPadding in class Drawable

setVisible

public boolean setVisible(boolean visible,
                          boolean restart)
Overrides:
setVisible in class Drawable

setDither

public void setDither(boolean dither)
Overrides:
setDither in class Drawable

setAlpha

public void setAlpha(int alpha)
Specified by:
setAlpha in class Drawable

setColorFilter

public void setColorFilter(ColorFilter cf)
Specified by:
setColorFilter in class Drawable

setOpacity

public void setOpacity(int opacity)

getOpacity

public int getOpacity()
Specified by:
getOpacity in class Drawable

isStateful

public boolean isStateful()
Overrides:
isStateful in class Drawable

onStateChange

protected boolean onStateChange(int[] state)
Overrides:
onStateChange in class Drawable

onLevelChange

protected boolean onLevelChange(int level)
Overrides:
onLevelChange in class Drawable

onBoundsChange

protected void onBoundsChange(Rect bounds)
Overrides:
onBoundsChange in class Drawable

getIntrinsicWidth

public int getIntrinsicWidth()
Overrides:
getIntrinsicWidth in class Drawable

getIntrinsicHeight

public int getIntrinsicHeight()
Overrides:
getIntrinsicHeight in class Drawable

getConstantState

public Drawable.ConstantState getConstantState()
Overrides:
getConstantState in class Drawable

mutate

public Drawable mutate()
Overrides:
mutate in class Drawable


Copyright © 2008-2012. All Rights Reserved.