Skip to content

Commit

Permalink
Remove FirebaseIndexRecyclerAdapter reference from documentation (fir…
Browse files Browse the repository at this point in the history
  • Loading branch information
Grimthorr authored and samtstern committed Oct 18, 2017
1 parent 728e62b commit 262d7f2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ public class Chat {
}
```

A few things to note abot this model class:
A few things to note about this model class:

* The getters and setters follow the JavaBean naming pattern which allows Firebase to map
the data to field names (ex: `getName()` provides the `name` field).
* The class has an empty constructor, which is required for Firebase's automatic data mapping.

For a properly constructed model class like the `Chat` class above, Firebase can perform automatic
serialization in `DatabaseReference#setValue()` and automatic deserialization in
`DataSnapshot.getValue()`.
`DataSnapshot#getValue()`.

### Querying

On the main screenof your app, you may want to show the 50 most recent chat messages. With Firebase
On the main screen of your app, you may want to show the 50 most recent chat messages. With Firebase
you would use the following query:

```java
Query query = FirebaseDatabase.getInstance()
.getReference()
.child("chats")
.limitToLast(50)
.limitToLast(50);
```

To retrieve this data without FirebaseUI, you might use `addChildEventListener` to listen for
Expand Down Expand Up @@ -140,7 +140,7 @@ FirebaseRecyclerAdapter adapter = new FirebaseRecyclerAdapter<Chat, ChatHolder>(
};
```

Finally attach the adapter to your `RecyclerView` with the `RecyclerView#setAdapter()`.
Finally attach the adapter to your `RecyclerView` with the `RecyclerView#setAdapter()` method.
Don't forget to also set a `LayoutManager`!


Expand Down Expand Up @@ -226,9 +226,7 @@ FirebaseListAdapter<Chat> adapter = new FirebaseListAdapter<Chat>(options) {
## Using FirebaseUI with indexed data

If your data is [properly indexed][indexed-data], change your adapter initialization
to use `setIndexedQuery`:

For a `RecyclerView`, use `FirebaseIndexRecyclerAdapter` instead of `FirebaseRecyclerAdapter`:
to use `setIndexedQuery()`:

```java
// keyQuery - the Firebase location containing the list of keys to be found in dataRef
Expand All @@ -239,11 +237,11 @@ FirebaseRecyclerOptions<Chat> options = new FirebaseRecyclerOptions.Builder<Chat
.build();
```

`keyQuery` is the location of your keys, and `dataRef` is the location of your data.
Where `keyQuery` is the location of your keys, and `dataRef` is the location of your data.

### A note on ordering

The order in which your receive your data depends on the order from `keyRef`, not `dataRef`:
The order in which you receive your data depends on the order from `keyRef`, not `dataRef`:

```javascript
{
Expand Down

0 comments on commit 262d7f2

Please sign in to comment.