@@ -118,10 +118,10 @@ Fear not, FirebaseUI does all of this for you automatically!
118
118
119
119
FirebaseUI offers two types of RecyclerView adapters for Cloud Firestore:
120
120
121
- * ` FirestoreRecyclerAdapter ` - bind a ` Query ` to a ` RecyclerView ` and respond to all real-time
121
+ * ` FirestoreRecyclerAdapter ` — binds a ` Query ` to a ` RecyclerView ` and respond to all real-time
122
122
events included items being added, removed, moved, or changed. Best used with small result sets
123
123
since all results are loaded at once.
124
- * ` FirestorePagingAdapter ` - bind a ` Query ` to a ` RecyclerView ` by loading data in pages. Best
124
+ * ` FirestorePagingAdapter ` — binds a ` Query ` to a ` RecyclerView ` by loading data in pages. Best
125
125
used with large, static data sets. Real-time events are not respected by this adapter, so it
126
126
will not detect new/removed items or changes to items already loaded.
127
127
@@ -177,7 +177,7 @@ FirestoreRecyclerAdapter adapter = new FirestoreRecyclerAdapter<Chat, ChatHolder
177
177
};
178
178
```
179
179
180
- Finally attach the adapter to your ` RecyclerView ` with the ` RecyclerView#setAdapter() ` .
180
+ Finally attach the adapter to your ` RecyclerView ` with the ` RecyclerView#setAdapter() ` method .
181
181
Don't forget to also set a ` LayoutManager ` !
182
182
183
183
#### ` FirestoreRecyclerAdapter ` lifecycle
@@ -253,7 +253,7 @@ The `FirestorePagingAdapter` is built on top of the [Android Paging Support Libr
253
253
Before using the adapter in your application, you must add a dependency on the support library:
254
254
255
255
``` groovy
256
- implementation 'android.arch.paging:runtime:1.0.0-beta1 '
256
+ implementation 'android.arch.paging:runtime:1.x.x '
257
257
```
258
258
259
259
First, configure the adapter by building ` FirestorePagingOptions ` . Since the paging adapter
@@ -293,7 +293,7 @@ If you need to customize how your model class is parsed, you can use a custom `S
293
293
});
294
294
```
295
295
296
- Next create the ` FirestorePagingAdapter ` object. You should already have a ` ViewHolder ` subclass
296
+ Next, create the ` FirestorePagingAdapter ` object. You should already have a ` ViewHolder ` subclass
297
297
for displaying each item. In this case we will use a custom ` ItemViewHolder ` class:
298
298
299
299
``` java
@@ -303,7 +303,7 @@ FirestorePagingAdapter<Item, ItemViewHolder> adapter =
303
303
@Override
304
304
public ItemViewHolder onCreateViewHolder (@NonNull ViewGroup parent , int viewType ) {
305
305
// Create the ItemViewHolder
306
- // ,,,
306
+ // ...
307
307
}
308
308
309
309
@Override
@@ -316,7 +316,7 @@ FirestorePagingAdapter<Item, ItemViewHolder> adapter =
316
316
};
317
317
```
318
318
319
- Finally attach the adapter to your ` RecyclerView ` with the ` RecyclerView#setAdapter() ` .
319
+ Finally attach the adapter to your ` RecyclerView ` with the ` RecyclerView#setAdapter() ` method .
320
320
Don't forget to also set a ` LayoutManager ` !
321
321
322
322
#### ` FirestorePagingAdapter ` lifecycle
@@ -338,7 +338,9 @@ protected void onStart() {
338
338
}
339
339
```
340
340
341
- Similarly, the ` stopListening() ` call removes the snapshot listener and all data in the adapter.
341
+ Similarly, the ` stopListening() ` call freezes the data in the ` RecyclerView ` and prevents any future
342
+ loading of data pages.
343
+
342
344
Call this method when the containing Activity or Fragment stops:
343
345
344
346
``` java
@@ -359,7 +361,7 @@ start and stop listening in `onStart()` and `onStop()`.
359
361
360
362
#### Paging events
361
363
362
- When using the ` FirestorePagingAdapter ` you may want to perform some action every time data
364
+ When using the ` FirestorePagingAdapter ` , you may want to perform some action every time data
363
365
changes or when there is an error. To do this, override the ` onLoadingStateChanged() `
364
366
method of the adapter:
365
367
0 commit comments