public class

ThumbnailItem

extends SubtitleItem
java.lang.Object
   ↳ greendroid.widget.item.Item
     ↳ greendroid.widget.item.TextItem
       ↳ greendroid.widget.item.SubtitleItem
         ↳ greendroid.widget.item.ThumbnailItem

Class Overview

A ThumbnailItem item is a complex item that wraps a Drawable and two Strings: a title and a subtitle. The representation of that Item is quite common to Android users: The Drawable is on the left of the item view and on the right the title and the subtitle are displayed like a SubtitleItem.

ThumbnailItem also support the AsyncImageView widget which enables asynchronous loading of images. When using ThumbnailItem in an asynchronous manner, use drawableId as the default image (the one displayed while loading) and drawableURL as the URL of the to-be-loaded image.

Summary

Fields
public int drawableId The resource ID for the Drawable.
public String drawableURL An optional URL that may be used to retrieve an image
[Expand]
Inherited Fields
From class greendroid.widget.item.SubtitleItem
From class greendroid.widget.item.TextItem
From class greendroid.widget.item.Item
Public Constructors
ThumbnailItem(String text, String subtitle, int drawableId)
Create a new ThumbnailItem.
ThumbnailItem(String text, String subtitle, int drawableId, String drawableURL)
Create a new ThumbnailItem which will asynchronously load the image at the given URL.
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.SubtitleItem
From class greendroid.widget.item.TextItem
From class greendroid.widget.item.Item
From class java.lang.Object

Fields

public int drawableId

The resource ID for the Drawable.

public String drawableURL

An optional URL that may be used to retrieve an image

Public Constructors

public ThumbnailItem (String text, String subtitle, int drawableId)

Create a new ThumbnailItem.

Parameters
text The text to draw
subtitle The subtitle to use
drawableId The resource identifier to the Drawable

public ThumbnailItem (String text, String subtitle, int drawableId, String drawableURL)

Create a new ThumbnailItem which will asynchronously load the image at the given URL.

Parameters
text The text to draw
subtitle The subtitle to use
drawableId The default image used when loading the image at the given drawableURL
drawableURL The URL pointing to the image to load.

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