public class

DrawableItem

extends TextItem
java.lang.Object
   ↳ greendroid.widget.item.Item
     ↳ greendroid.widget.item.TextItem
       ↳ greendroid.widget.item.DrawableItem

Class Overview

A DrawableItem displays a single Drawable on the left of the itemview and a description text on the right. A DrawableItem takes care of adapting itself depending on the presence of its Drawable.

Summary

Fields
public int drawableId The resource identifier for the Drawable.
[Expand]
Inherited Fields
From class greendroid.widget.item.TextItem
From class greendroid.widget.item.Item
Public Constructors
DrawableItem(String text)
Constructs a new DrawableItem that has no Drawable and displays the given text.
DrawableItem(String text, int drawableId)
Constructs a new DrawableItem using the specified text and Drawable
Public Methods
void inflate(Resources r, XmlPullParser parser, AttributeSet attrs)
Inflate this Item from an XML resource.
ItemView newView(Context context, ViewGroup parent)
Return a view that is associated to the current item.
[Expand]
Inherited Methods
From class greendroid.widget.item.TextItem
From class greendroid.widget.item.Item
From class java.lang.Object

Fields

public int drawableId

The resource identifier for the Drawable.

Public Constructors

public DrawableItem (String text)

Constructs a new DrawableItem that has no Drawable and displays the given text. Used as it, a DrawableItem is very similar to a TextItem

Parameters
text The text of this DrawableItem

public DrawableItem (String text, int drawableId)

Constructs a new DrawableItem using the specified text and Drawable

Parameters
text The text of this DrawableItem
drawableId The resource identifier of the Drawable

Public Methods

public void inflate (Resources r, XmlPullParser parser, AttributeSet attrs)

Inflate this Item from an XML resource.

public ItemView newView (Context context, ViewGroup parent)

Return a view that is associated to the current item. The returned view is normally capable of being a good recipient for all item's information.

Parameters
context The Context in which the ItemView will be used
parent The parent View of that new View. The parent is usually the parent ListView and may be used to retrieve the correct LayoutParams type.
Returns
  • A new allocated view for the current Item