Skip to content

Commit 8bede03

Browse files
committed
Doc updates (review feedback)
Change-Id: Iae9801e965664f987e892968df362186b7c9a8f2
1 parent bf0ac33 commit 8bede03

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

firestore/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ Fear not, FirebaseUI does all of this for you automatically!
118118

119119
FirebaseUI offers two types of RecyclerView adapters for Cloud Firestore:
120120

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
122122
events included items being added, removed, moved, or changed. Best used with small result sets
123123
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
125125
used with large, static data sets. Real-time events are not respected by this adapter, so it
126126
will not detect new/removed items or changes to items already loaded.
127127

@@ -177,7 +177,7 @@ FirestoreRecyclerAdapter adapter = new FirestoreRecyclerAdapter<Chat, ChatHolder
177177
};
178178
```
179179

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.
181181
Don't forget to also set a `LayoutManager`!
182182

183183
#### `FirestoreRecyclerAdapter` lifecycle
@@ -253,7 +253,7 @@ The `FirestorePagingAdapter` is built on top of the [Android Paging Support Libr
253253
Before using the adapter in your application, you must add a dependency on the support library:
254254

255255
```groovy
256-
implementation 'android.arch.paging:runtime:1.0.0-beta1'
256+
implementation 'android.arch.paging:runtime:1.x.x'
257257
```
258258

259259
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
293293
});
294294
```
295295

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
297297
for displaying each item. In this case we will use a custom `ItemViewHolder` class:
298298

299299
```java
@@ -303,7 +303,7 @@ FirestorePagingAdapter<Item, ItemViewHolder> adapter =
303303
@Override
304304
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
305305
// Create the ItemViewHolder
306-
// ,,,
306+
// ...
307307
}
308308

309309
@Override
@@ -316,7 +316,7 @@ FirestorePagingAdapter<Item, ItemViewHolder> adapter =
316316
};
317317
```
318318

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.
320320
Don't forget to also set a `LayoutManager`!
321321

322322
#### `FirestorePagingAdapter` lifecycle
@@ -338,7 +338,9 @@ protected void onStart() {
338338
}
339339
```
340340

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+
342344
Call this method when the containing Activity or Fragment stops:
343345

344346
```java
@@ -359,7 +361,7 @@ start and stop listening in `onStart()` and `onStop()`.
359361

360362
#### Paging events
361363

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
363365
changes or when there is an error. To do this, override the `onLoadingStateChanged()`
364366
method of the adapter:
365367

firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public void startListening() {
114114
}
115115

116116
/**
117-
* Unsubscribe from paging / scrolling events, no more data will be populated.
117+
* Unsubscribe from paging / scrolling events, no more data will be populated, but the existing
118+
* data will remain.
118119
*/
119120
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
120121
public void stopListening() {

0 commit comments

Comments
 (0)