FileDocCategorySizeDatePackage
BaseExpandableListAdapter.javaAPI DocAndroid 1.5 API3397Wed May 06 22:41:56 BST 2009android.widget

BaseExpandableListAdapter

public abstract class BaseExpandableListAdapter extends Object implements ExpandableListAdapter
Base class for a {@link ExpandableListAdapter} used to provide data and Views from some data to an expandable list view.

Adapters inheriting this class should verify that the base implementations of {@link #getCombinedChildId(long, long)} and {@link #getCombinedGroupId(long)} are correct in generating unique IDs from the group/children IDs.

see
SimpleExpandableListAdapter
see
SimpleCursorTreeAdapter

Fields Summary
private final android.database.DataSetObservable
mDataSetObservable
Constructors Summary
Methods Summary
public booleanareAllItemsEnabled()

        return true;
    
public longgetCombinedChildId(long groupId, long childId)
Override this method if you foresee a clash in IDs based on this scheme:

Base implementation returns a long:

  • bit 0: Whether this ID points to a child (unset) or group (set), so for this method this bit will be 1.
  • bit 1-31: Lower 31 bits of the groupId
  • bit 32-63: Lower 32 bits of the childId.

    {@inheritDoc}

            return 0x8000000000000000L | ((groupId & 0x7FFFFFFF) << 32) | (childId & 0xFFFFFFFF);
        
  • public longgetCombinedGroupId(long groupId)
    Override this method if you foresee a clash in IDs based on this scheme:

    Base implementation returns a long:

  • bit 0: Whether this ID points to a child (unset) or group (set), so for this method this bit will be 0.
  • bit 1-31: Lower 31 bits of the groupId
  • bit 32-63: Lower 32 bits of the childId.

    {@inheritDoc}

            return (groupId & 0x7FFFFFFF) << 32;
        
  • public booleanisEmpty()
    {@inheritDoc}

            return getGroupCount() == 0;
        
    public voidnotifyDataSetChanged()
    {@see DataSetObservable#notifyChanged()}

            mDataSetObservable.notifyChanged();
        
    public voidnotifyDataSetInvalidated()
    {@see DataSetObservable#notifyInvalidated()}

            mDataSetObservable.notifyInvalidated();
        
    public voidonGroupCollapsed(int groupPosition)

        
    public voidonGroupExpanded(int groupPosition)

        
    public voidregisterDataSetObserver(android.database.DataSetObserver observer)

        
            
            mDataSetObservable.registerObserver(observer);
        
    public voidunregisterDataSetObserver(android.database.DataSetObserver observer)

            mDataSetObservable.unregisterObserver(observer);