Application pages
I am currently planning out how I am going to implement multi page layouts in Titanium. I have got two main concepts right now:
Concept 1
A Page
class would be instantiated and nodes you wish to contain on that page of the application would be added to that instance. When the page of the app is changed, a method would be called (likely on an Application
instance) that will replace the nodes on the application with the nodes inside the Page.
This concept may also allow for page naming and could be used to set the page using something along the lines of ApplicationInstance:changePage "pageName"
once the page was added to the application.
Concept 2
The second concepts could be a node (maybe PageContainer
) that is an extended version of Container
that allows you to register pages PageContainerInstance:registerPage(pageName, {pageNodes})
and switch to pages on the fly.
This concept is similar to concept one, however with this concept you can paginate certain sections of the application as opposed to the entire application.
In all reality, a combination of these two concepts will likely be introduced in the future. Between now and then I would love to hear your thoughts and ideas. Feel free to suggest your ideas for how Titanium could make multi-page applications easier.