简体   繁体   English

如何在 Firebase 中的 reyclerview 中检索另一个数据下方的数据

[英]How retrieve data below another data inside reyclerview in Firebase

I have a shop app where people can post comments about a product and other people can answer below the first comment.我有一个商店应用程序,人们可以在其中发表有关产品的评论,其他人可以在第一条评论下方进行回答。

I want to retrieve the comment and its replies into one Recyclerview like Instagram does, as shown in the following image.我想像 Instagram 那样将评论及其回复检索到一个Recyclerview中,如下图所示。 But I don't know where to start can you help me thanks但我不知道从哪里开始,你能帮我吗谢谢

在此处输入图片说明

My approach would be to have a RecyclerView for all the comments.我的方法是为所有评论设置一个 RecyclerView。 Each comment item would have a layout containing the comment content and a RecyclerView for its replies.每个评论项都有一个包含评论内容的布局和一个用于回复的 RecyclerView。

So, for example, your data could be a list of Comment objects with each one having a list of Reply objects inside it.因此,例如,您的数据可以是一个 Comment 对象列表,其中每个对象都有一个 Reply 对象列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM