How to add a comment box in android studio

Viewed 98

So, I want to add a comment section for each movie/video in my Netlix Clone app.
I have designed a recycler view for comment box which shows user name and comment that user added.
I added comment to cloud firebase using firestore.

Project link : https://github.com/Shivansh0103/NetflixClone

What I want to do is to get separate comments for each movie not like same comment on every screen as shown in images but I don't know how to do that(like maybe link movieid to comment but I failed to do that.

This is demo screen you can see comment box [1]: https://i.stack.imgur.com/3vtqu.png

You can see comment box has same comment here as well which i want to remove and reset to be empty. [2]: https://i.stack.imgur.com/Rauhw.png

This is where I added the data in firebase. [3]: https://i.stack.imgur.com/BgXGc.png

1 Answers

For each comment includ movie unique ID if you have, if you don't have unique ID store movie name

Also save them in new collection like this

Firestore.getInstance().collection("Users").document(userUid).collection(allComments).add(_userComment)

Then get comments like this

Firestore.getInstance().collectiongroup("allComments").where("movieID",_currentMovieID)
Related