I am writing an android app for a watch (ZGPAX S6). Very small screen, Android SDK 14 target. I intend to run this app without a title bar at the top, or tabs. This will be a full screen app - real estate on a 1.54 inch screen is precious.
I have a single layout in mind, but 10 or more "screens" in the app. Is it possible to manage "logical fragments" instead of actually laying everything out in a layout xml file?
For instance, my screens are all "4 up" - shows 4 data pieces in a grid. I intend to use a swipe gesture to move between a set of logical screens for this app.
- 4up (screen A)
- 4up (screen B)
- 4up (screen C) etc.
Right now I have a single activity, an arraylist that holds "screens" (a title and a type of data) and a single layout file that has the 4up elements coded into it. I use a click handler to move to the next spot in the arraylist and repaint the elements on the screen. The data elements themselves are being read off of a network connection and refreshed to the screen as they come in. This part works great.
I want to use all screen transitions along with my gesture to make it look like a horizontal scrolling list of these screens, but there is only 1 of them... So I would draw screen 1, swipe right to get to screen 2, swipe right to get to screen 3 etc.
The progression of the application looks like this (pseudocode):
onCreate{
get handles to the elements of the layout
setupScreenData() - this sets up the arraylist of "screens"
run the network listener() - this starts a thread and connects to the activity via a Handler
}
//this happens when I get data from the network
handleMessage{
//this combines data in the screens array with data sent back from the network
refreshScreenData()
}
onClick{
increment the pointer in the screen array
}