Build 1.0_r1(from source)

android.graphics.drawable
Class ShapeDrawable.ShaderFactory

java.lang.Object
  extended by android.graphics.drawable.ShapeDrawable.ShaderFactory
Enclosing class:
ShapeDrawable

public abstract static class ShapeDrawable.ShaderFactory
extends Object

Base class defines a factory object that is called each time the drawable is resized (has a new width or height). Its resize() method returns a corresponding shader, or null. Implement this class if you'd like your ShapeDrawable to use a special Shader, such as a LinearGradient.


Constructor Summary
ShapeDrawable.ShaderFactory()
           
 
Method Summary
abstract  Shader resize(int width, int height)
          Returns the Shader to be drawn when a Drawable is drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeDrawable.ShaderFactory

public ShapeDrawable.ShaderFactory()
Method Detail

resize

public abstract Shader resize(int width,
                              int height)
Returns the Shader to be drawn when a Drawable is drawn. The dimensions of the Drawable are passed because they may be needed to adjust how the Shader is configured for drawing. This is called by ShapeDrawable.setShape().

Parameters:
width - the width of the Drawable being drawn
height - the heigh of the Drawable being drawn
Returns:
the Shader to be drawn

Build 1.0_r1(from source)

Please submit a feedback, bug or feature