Hey there!
I am a bit unsure how to structure my app.
It is basically: A homescreen with 3 buttons. 2 of those buttons open a new page and one button that triggers an alert or modal window.
Page 1 contains a scrollableView, each scrollableView contains several buttons and an audio player. Page 2 contains text only and maybe an image. The alert/modal window contains information about the app.
Page 1 and Page 2 should contain a button to get back to the homescreen.
I don't want to it all in one file so I am thinking about splitting it up into at least 2 files and I want the page 1 audio stuff to be in a seperate file.
At the moment I am using a tab group and the url-paramater to load three different files for the three different pages. It works (technically) but it is ugly and it does not quite fit into the app (design-wise).
So I am looking for alternatives and a helping hand that pushes me in the right direction.
What would you guys recommend? Put it all into a single file, working with multiple views in just one single window?
The Kitchensink is using the tab-group so I am struggling to get inspiration.
1 Answer
My advice would be to split each page into a separate file. In the app.js file I would display the buttons that link to each separate page and have the click event create a new window with the url set to that new page/file. Any functions that you wanted available in the scope of the new window/page/file you would just include with a Titanium.include('functions.js'); Simply have a file named functions.js that you place your global functions into. You could place your apps information directly in app.js, or better: you could place it as a function in functions.js
The overall goal is to have something functional but to make sure that your code is separated enough to make it easy for you to find/read.
Your Answer
Think you can help? Login to answer this question!