As a Newbie I am trying to make a diary function where a timeline contains diary entries. Please see attached example of another app. Setting up the diary scroll poses a major hurdle right away. I thought that Mevi’s calendar function with alterations would help me to set it up but that is not viable I think.
Is there anyone who could help me with an approach on how to solve this problem?
Thanks in advance,
For this I can imagine a custom built “accordion”-like component.
Okay let’s break it down.
The data is in fact a list of objects, right?
“diet” this has properties like these:
- date (dd.mm.yyyy)
- meals (another list of objects)
So the meals are part of the diet and they have properties like this:
So we have the data setup which is a list of objects in which we have another list of objects.
Now we need the view components.
- top container
- diet of a day container
- single meal container
You will need to repeat the “diet of a day container” with the “diet” list of objects (make sure to add an alias to that in order to avoid issues when setting data)
And then you will need to repeat the “single meal container” with the “meals” property of the “diet” list of objects (set the alias to something else than “current”)
Inside the “diet of the day” container You need to add a “title” or text view component and set its value to the date property.
Inside the “single meal container” you need to add a few other containers to have a good control of the layout or simply add in texts and icons and set those values to data from the meals property of the data.
Hope this sheds a little light on the request.
(This is totally solvable, but will take some time to get Your head around with the data.)
One small note. If you want to add floating buttons or custom navigation, you’ll need to place the top level container (containing all the rest) into a scroll view.
Thank you so much for your answer. A lot of it makes sense, but I have to get my head around the data setup.
As a base container for all I had thought of a scrolling container so the dates with contents can be moved up and down at will.
How do I set up all the dates so that they appear in a vertical row?
Many thanks again,
I may need to clarify a bit more regarding the dates showing in sequence:
You said: “Inside the “diet of the day” container You need to add a “title” or text view component and set its value to the date property.”
OK! But how does it repeat +1day below and -1day above when “the diet of the day” container is repeated in the Top container?