Drawable

Class of android.graphics.drawable · Drawable.java · Android's reference

public abstract class Drawable

Something that draws itself into bounds: the base of the framework's drawables.

Nested types

Extended in the framework by

Page 1 2

Methods

public static Drawable load(Resources res, int id, Resources.Theme theme) source

The drawable of a resource, as Android's ResourcesImpl.loadDrawable makes it: a color is a ColorDrawable, an XML file is inflated by the class of its root tag, and an image file is decoded at the resource's density (a BitmapDrawable, or a NinePatchDrawable when the PNG has a nine-patch chunk).

public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException source

The drawable of an XML document: its first element, inflated by createFromXmlInner.

public static Drawable createFromXml(Resources r, XmlPullParser parser, Resources.Theme theme) throws XmlPullParserException, IOException source
public static Drawable createFromResourceStream(Resources res, TypedValue value, InputStream is, String srcName) source

A drawable of an encoded image: a BitmapDrawable, or a NinePatchDrawable when the image has a nine-patch chunk.

public static Drawable createFromResourceStream(Resources res, TypedValue value, InputStream is, String srcName, android.graphics.BitmapFactory.Options opts) source
public static Drawable createFromStream(InputStream is, String srcName) source
public static Drawable createFromPath(String pathName) source
public static Drawable createFromXmlInner(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException source

The drawable of an XML element that the parser is on: an empty drawable of the tag's class, then inflated.

public static Drawable createFromXmlInner(Resources r, XmlPullParser parser, AttributeSet attrs) throws XmlPullParserException, IOException source
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs) throws XmlPullParserException, IOException source
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException source

The base drawable reads only android:visible.

public abstract void draw(Canvas canvas) source
public void setBounds(int left, int top, int right, int bottom) source
public void setBounds(Rect b) source
public final void copyBounds(Rect bounds) source
public final Rect copyBounds() source
public final Rect getBounds() source
public Rect getDirtyBounds() source
public void setChangingConfigurations(int configs) source
public int getChangingConfigurations() source
public void setDither(boolean dither) empty body deprecated source
public void setFilterBitmap(boolean filter) empty body source
public boolean isFilterBitmap() source
public final void setCallback(Callback cb) source
public Callback getCallback() source
public void invalidateSelf() source
public void scheduleSelf(Runnable what, long when) source
public void unscheduleSelf(Runnable what) source
public int getLayoutDirection() source
public final boolean setLayoutDirection(int dir) source

Page 1 2


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.