File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,18 @@ with our chat example:
130130 .build();
131131```
132132
133+ If you need to customize how your model class is parsed, you can use a custom ` SnapshotParser ` :
134+
135+ ``` java
136+ .. . setQuery(... , new SnapshotParser<Chat > () {
137+ @NonNull
138+ @Override
139+ public Chat parseSnapshot (@NonNull DataSnapshot snapshot ) {
140+ return ... ;
141+ }
142+ });
143+ ```
144+
133145Next create the ` FirebaseRecyclerAdapter ` object. You should already have a ` ViewHolder ` subclass
134146for displaying each item. In this case we will use a custom ` ChatHolder ` class:
135147
Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ FirestoreRecyclerOptions<Chat> options = new FirestoreRecyclerOptions.Builder<Ch
126126 .build();
127127```
128128
129+ If you need to customize how your model class is parsed, you can use a custom ` SnapshotParser ` :
130+
131+ ``` java
132+ .. . setQuery(... , new SnapshotParser<Chat > () {
133+ @NonNull
134+ @Override
135+ public Chat parseSnapshot (@NonNull DocumentSnapshot snapshot ) {
136+ return ... ;
137+ }
138+ });
139+ ```
140+
129141Next create the ` FirestoreRecyclerAdapter ` object. You should already have a ` ViewHolder ` subclass
130142for displaying each item. In this case we will use a custom ` ChatHolder ` class:
131143
You can’t perform that action at this time.
0 commit comments