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:
130
130
.build();
131
131
```
132
132
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
+
133
145
Next create the ` FirebaseRecyclerAdapter ` object. You should already have a ` ViewHolder ` subclass
134
146
for displaying each item. In this case we will use a custom ` ChatHolder ` class:
135
147
Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ FirestoreRecyclerOptions<Chat> options = new FirestoreRecyclerOptions.Builder<Ch
126
126
.build();
127
127
```
128
128
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
+
129
141
Next create the ` FirestoreRecyclerAdapter ` object. You should already have a ` ViewHolder ` subclass
130
142
for displaying each item. In this case we will use a custom ` ChatHolder ` class:
131
143
You can’t perform that action at this time.
0 commit comments