Below is my sample structure:
channels
|
|____channel0
|
|___messages
|
|_______ uniqueKey0: true
|
|_______ uniqueKey1: true
messages
|
|_____ uniqueKey0
| |______ from: Alex
| |______ text: Hi!
|
|
|_____ uniqueKey1
|______ from: Kate
|______ text: Hello
I am trying out Firebase UI Recycler View to messages. I have two questions:
What I am doing is giving ref of /channels/messages to FirebaseAdapter and get the key. Once key is fetched, I fetch details and then populate the view holder. In this case, am not sure how to handle the case where a message's text is changed. Because since am listening to /channels/messages, I don't get the event of message change.
To tackle the above problem, I was thinking of the following structure, which I know is against the best practices since am supposed to keep data as flat as possible. So I wanted I know that going for this approach is really that bad or makes more sense in this case?
messages | |____channel0 |_____ uniqueKey0 | |______ from: Alex | |______ text: Hi! | | |_____ uniqueKey1 |______ from: Kate |______ text: Hello