com.github.droidfu.adapters
Class ListAdapterWithProgress<T>

java.lang.Object
  extended by android.widget.BaseAdapter
      extended by com.github.droidfu.adapters.ListAdapterWithProgress<T>
All Implemented Interfaces:
android.widget.Adapter, android.widget.ListAdapter, android.widget.SpinnerAdapter

public abstract class ListAdapterWithProgress<T>
extends android.widget.BaseAdapter


Field Summary
 
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
 
Constructor Summary
ListAdapterWithProgress(android.app.Activity activity, android.widget.AbsListView listView, int progressDrawableResourceId)
           
ListAdapterWithProgress(android.app.ExpandableListActivity activity, int progressDrawableResourceId)
           
ListAdapterWithProgress(android.app.ListActivity activity, int progressDrawableResourceId)
           
 
Method Summary
 void addAll(List<T> items)
           
 void addAll(List<T> items, boolean redrawList)
           
 boolean areAllItemsEnabled()
           
 void clear()
           
protected abstract  android.view.View doGetView(int position, android.view.View convertView, android.view.ViewGroup parent)
           
 int getCount()
          
 ArrayList<T> getData()
           
 T getItem(int position)
           
 int getItemCount()
           
 long getItemId(int position)
           
 int getItemViewType(int position)
           
 android.widget.AbsListView getListView()
           
 android.view.View getProgressView()
           
 android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent)
           
 int getViewTypeCount()
           
 boolean hasItems()
           
 boolean isEmpty()
          
 boolean isEnabled(int position)
           
 boolean isLoadingData()
           
 void remove(int position)
           
 void setIsLoadingData(boolean isLoadingData)
           
 void setIsLoadingData(boolean isLoadingData, boolean redrawList)
           
 
Methods inherited from class android.widget.BaseAdapter
getDropDownView, hasStableIds, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListAdapterWithProgress

public ListAdapterWithProgress(android.app.ListActivity activity,
                               int progressDrawableResourceId)

ListAdapterWithProgress

public ListAdapterWithProgress(android.app.ExpandableListActivity activity,
                               int progressDrawableResourceId)

ListAdapterWithProgress

public ListAdapterWithProgress(android.app.Activity activity,
                               android.widget.AbsListView listView,
                               int progressDrawableResourceId)
Method Detail

getListView

public android.widget.AbsListView getListView()

getProgressView

public android.view.View getProgressView()

getCount

public int getCount()

Don't use this to check for the presence of actual data items; use hasItems() instead.


isEmpty

public boolean isEmpty()

Don't use this to check for the presence of actual data items; use hasItems() instead.

Specified by:
isEmpty in interface android.widget.Adapter
Overrides:
isEmpty in class android.widget.BaseAdapter

getItemCount

public int getItemCount()
Returns:
the actual number of data items in this adapter, ignoring the progress item.

hasItems

public boolean hasItems()
Returns:
true if there are actual data items, ignoring the progress item.

getItem

public T getItem(int position)

getItemId

public long getItemId(int position)

isEnabled

public boolean isEnabled(int position)
Specified by:
isEnabled in interface android.widget.ListAdapter
Overrides:
isEnabled in class android.widget.BaseAdapter

areAllItemsEnabled

public boolean areAllItemsEnabled()
Specified by:
areAllItemsEnabled in interface android.widget.ListAdapter
Overrides:
areAllItemsEnabled in class android.widget.BaseAdapter

setIsLoadingData

public void setIsLoadingData(boolean isLoadingData)

setIsLoadingData

public void setIsLoadingData(boolean isLoadingData,
                             boolean redrawList)

isLoadingData

public boolean isLoadingData()

getView

public final android.view.View getView(int position,
                                       android.view.View convertView,
                                       android.view.ViewGroup parent)

doGetView

protected abstract android.view.View doGetView(int position,
                                               android.view.View convertView,
                                               android.view.ViewGroup parent)

getItemViewType

public int getItemViewType(int position)
Specified by:
getItemViewType in interface android.widget.Adapter
Overrides:
getItemViewType in class android.widget.BaseAdapter

getViewTypeCount

public int getViewTypeCount()
Specified by:
getViewTypeCount in interface android.widget.Adapter
Overrides:
getViewTypeCount in class android.widget.BaseAdapter

getData

public ArrayList<T> getData()

addAll

public void addAll(List<T> items)

addAll

public void addAll(List<T> items,
                   boolean redrawList)

clear

public void clear()

remove

public void remove(int position)


Copyright © 2011. All Rights Reserved.