FileDocCategorySizeDatePackage
ResourceCursorTreeAdapter.javaAPI DocAndroid 1.5 API4497Wed May 06 22:41:56 BST 2009android.widget

ResourceCursorTreeAdapter

public abstract class ResourceCursorTreeAdapter extends CursorTreeAdapter
A fairly simple ExpandableListAdapter that creates views defined in an XML file. You can specify the XML file that defines the appearance of the views.

Fields Summary
private int
mCollapsedGroupLayout
private int
mExpandedGroupLayout
private int
mChildLayout
private int
mLastChildLayout
private android.view.LayoutInflater
mInflater
Constructors Summary
public ResourceCursorTreeAdapter(android.content.Context context, android.database.Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout, int lastChildLayout)
Constructor.

param
context The context where the ListView associated with this SimpleListItemFactory is running
param
cursor The database cursor
param
collapsedGroupLayout resource identifier of a layout file that defines the views for collapsed groups.
param
expandedGroupLayout resource identifier of a layout file that defines the views for expanded groups.
param
childLayout resource identifier of a layout file that defines the views for all children but the last..
param
lastChildLayout resource identifier of a layout file that defines the views for the last child of a group.

        super(cursor, context);
        
        mCollapsedGroupLayout = collapsedGroupLayout;
        mExpandedGroupLayout = expandedGroupLayout;
        mChildLayout = childLayout;
        mLastChildLayout = lastChildLayout;
        
        mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
public ResourceCursorTreeAdapter(android.content.Context context, android.database.Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout)
Constructor.

param
context The context where the ListView associated with this SimpleListItemFactory is running
param
cursor The database cursor
param
collapsedGroupLayout resource identifier of a layout file that defines the views for collapsed groups.
param
expandedGroupLayout resource identifier of a layout file that defines the views for expanded groups.
param
childLayout resource identifier of a layout file that defines the views for all children.

        this(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout, childLayout);
    
public ResourceCursorTreeAdapter(android.content.Context context, android.database.Cursor cursor, int groupLayout, int childLayout)
Constructor.

param
context The context where the ListView associated with this SimpleListItemFactory is running
param
cursor The database cursor
param
groupLayout resource identifier of a layout file that defines the views for all groups.
param
childLayout resource identifier of a layout file that defines the views for all children.

        this(context, cursor, groupLayout, groupLayout, childLayout, childLayout);
    
Methods Summary
public android.view.ViewnewChildView(android.content.Context context, android.database.Cursor cursor, boolean isLastChild, android.view.ViewGroup parent)

        return mInflater.inflate((isLastChild) ? mLastChildLayout : mChildLayout, parent, false);
    
public android.view.ViewnewGroupView(android.content.Context context, android.database.Cursor cursor, boolean isExpanded, android.view.ViewGroup parent)

        return mInflater.inflate((isExpanded) ? mExpandedGroupLayout : mCollapsedGroupLayout,
                parent, false);