I have run across a familiar programming pattern needed in creating my app “Lexington by Foot and Phone”. (tourlex.glideapp.io) This is an app that offers multiple walking tours for my home town.
In the app, there are at least two collections of similar objects:
LexByFootAndPhione is a collection of Tours. A Tour is a collection of Stops.
As a result, I have at least three types of layouts: one for each of the App, the Tours, and the Stops.
Let’s consider the layout for showing Tours. Here are three (of the current five) Tour screens:
Here is the initial layout for each of the five tours (three of which are shown):
Notice that there are 5 buttons that are replications of the same Button component type all with the label “Show list of tour stops”. To get the proper set stops to be selected each of the five conditionally appearing buttons has a different item selection filter.
This pattern is needed at several places in the app. The problem I am having is imagining what is going to happen when I expand the number of Tours from 5 to 15. Managing those 15 button components is going to be difficult.
I am sure other developers must have faced the same problem and so I am asking if anyone solves this problem using some construct in Glide that I am not aware of.
Regards,
– Harry