O
O
OlehCoding2019-01-08 20:09:25
Java
OlehCoding, 2019-01-08 20:09:25

How to implement master-detail flow with fragments and firebase realtime database?

Hi guys!
I need to implement an application like in these screenshots.
And understand how I can do it better and with what navigation.

spoiler
THdOUKY.png7nPdDDH.pngUc6o7Nh.pngYirhD9z.png

Here are all my models https://gist.github.com/Olegcoding/9e1eb76fd4558d8...
db itself in short
8019d9791caf79c5ccaf77c76b42732d.png

What is the logic here? Main fragment with a sheet into which info with titles is loaded, but I don’t understand how to make it so that when I click on an item from the sheet, I get another fragment with info from db, which will either expand or it will have a more detailed button, or it will be simple sheet. I would be very grateful if anyone can help me and point me in the right direction!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2019-01-09
@RomReed

You don't have the correct data structure, so you don't understand it. In the main screen you have a list of topics. This list should be separate and each topic should have its own unique id. Next, you need to create a questions field in which, by the key from the main, you will find out what questions are in it. And you also need to create questionsDetailes where the id from questions will contain all the details on this issue.
id firebase can generate itself. here is an example in android.
read documentation
https://firebase.google.com/docs/database/android/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question