33
33
import android .view .ViewGroup ;
34
34
import android .widget .BaseAdapter ;
35
35
36
+ import com .firebase .client .Firebase ;
36
37
import com .firebase .client .Query ;
37
38
38
39
/**
@@ -53,16 +54,16 @@ public abstract class FirebaseListAdapter<T> extends BaseAdapter {
53
54
54
55
55
56
/**
56
- * @param modelClass Firebase will marshall the data at a location into an instance of a class that you provide
57
- * @param layout This is the mLayout used to represent a single list item. You will be responsible for populating an
58
- * instance of the corresponding view with the data from an instance of mModelClass.
59
57
* @param activity The activity containing the ListView
60
- * @param ref The Firebase location to watch for data changes. Can also be a slice of a location, using some
58
+ * @param modelClass Firebase will marshall the data at a location into an instance of a class that you provide
59
+ * @param modelLayout This is the layout used to represent a single list item. You will be responsible for populating an
60
+ * instance of the corresponding view with the data from an instance of modelClass.
61
+ * @param ref The Firebase location to watch for data changes. Can also be a slice of a location, using some
61
62
* combination of <code>limit()</code>, <code>startAt()</code>, and <code>endAt()</code>,
62
63
*/
63
- public FirebaseListAdapter (Class <T > modelClass , int layout , Activity activity , Query ref ) {
64
+ public FirebaseListAdapter (Activity activity , Class <T > modelClass , int modelLayout , Query ref ) {
64
65
mModelClass = modelClass ;
65
- mLayout = layout ;
66
+ mLayout = modelLayout ;
66
67
mActivity = activity ;
67
68
mSnapshots = new FirebaseArray (ref );
68
69
mSnapshots .setOnChangedListener (new FirebaseArray .OnChangedListener () {
@@ -72,6 +73,17 @@ public void onChanged(EventType type, int index, int oldIndex) {
72
73
}
73
74
});
74
75
}
76
+ /**
77
+ * @param activity The activity containing the ListView
78
+ * @param modelClass Firebase will marshall the data at a location into an instance of a class that you provide
79
+ * @param modelLayout This is the layout used to represent a single list item. You will be responsible for populating an
80
+ * instance of the corresponding view with the data from an instance of modelClass.
81
+ * @param ref The Firebase location to watch for data changes. Can also be a slice of a location, using some
82
+ * combination of <code>limit()</code>, <code>startAt()</code>, and <code>endAt()</code>,
83
+ */
84
+ public FirebaseListAdapter (Activity activity , Class <T > modelClass , int modelLayout , Firebase ref ) {
85
+ this (activity , modelClass , modelLayout , (Query )ref );
86
+ }
75
87
76
88
public void cleanup () {
77
89
// We're being destroyed, let go of our mListener and forget about all of the mModels
0 commit comments