public abstract class FirebaseListAdapter<T>
extends android.widget.BaseAdapter
| Constructor and Description |
|---|
FirebaseListAdapter(DatabaseReference mRef,
java.lang.Class<T> mModelClass,
android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
int |
getCount() |
java.lang.Object |
getItem(int i) |
long |
getItemId(int i) |
int |
getItemViewType(int position) |
protected abstract int |
getItemViewType(int position,
T model) |
android.view.View |
getView(int i,
android.view.View view,
android.view.ViewGroup viewGroup) |
int |
getViewTypeCount() |
protected abstract android.view.View |
populateView(android.view.LayoutInflater inflater,
android.view.View v,
android.view.ViewGroup parent,
T model)
Each time the data at the given Firebase location changes, this method will be called for each item that needs
to be displayed.
|
public FirebaseListAdapter(DatabaseReference mRef,
java.lang.Class<T> mModelClass,
android.content.Context context)
mRef - The Firebase location to watch for data changes. Can also be a slice of a location, using some
combination of limit(), startAt(), and endAt(),mModelClass - Firebase will marshall the data at a location into an instance of a class that you providepublic void cleanup()
public int getItemViewType(int position)
getItemViewType in interface android.widget.AdaptergetItemViewType in class android.widget.BaseAdapterpublic int getViewTypeCount()
getViewTypeCount in interface android.widget.AdaptergetViewTypeCount in class android.widget.BaseAdapterpublic int getCount()
public java.lang.Object getItem(int i)
public long getItemId(int i)
public android.view.View getView(int i,
android.view.View view,
android.view.ViewGroup viewGroup)
protected abstract int getItemViewType(int position,
T model)
protected abstract android.view.View populateView(android.view.LayoutInflater inflater,
android.view.View v,
android.view.ViewGroup parent,
T model)
Your implementation should populate the view using the data contained in the model.
v - The view to populatemodel - The object containing the data used to populate the view