I'm on a mission to try to find out how some of the big guys' apps would function in appcelerator. A week or two ago, Dan Tamas did an amazing job figuring out how twitter handles their swipe-to-reveal feature on tableviews (http://developer.appcelerator.com/question/139133/twitter-like-swipe-on-tableview) and I've got two more questions I have left to figure out, so just posting one here incase someone has any hints or can point me in the right direction to start!
Facebook-like Static Menu If you have ever used the Facebook mobile app (and if you have an iPhone I'm assuming you probably have) you may have noticed that when you navigate pages the top menu bar (with the three buttons) never actually moves! The top left/right nav buttons change depending on whether you can go back to the previous page or not, but the three buttons stay in the same place at all times! Really cool stuff, because it allows them to show how many notifications you have wherever you are in the app.
So the question there is... How does the Facebook app create/manage back buttons without ever actuallyrefreshing that top menu? AND, is that top menu then just a window placed over a one-tab tabgroup (or a navgroup)?
If what I'm saying above is right.. there would have to be 3 windows stacked on top of each other... Is that even possible?
My initial thought:
1) Initial window is a menu window opened first so it is below the content win (to create facebook's slider menu effect).
2) Second is a globally referenced tabgroup with one tab thats content can be changed like "globals.tabGroup.currentTab.open(newWindow);". IF that's the case, we would also probably have to keep track of the current window in a "globals.tabGroup.currentWindow;" type variable so that we can close it from another window (outside of the tab group). This window could also (maybe?) be set to keep a constant global variable of how many "layers" of windows it has open, and use that to change the top left and top right navbar buttons in the 3rd window to either "back" or "menu" (if it's the initial window in the stack).
3) A 3rd window opened on top that holds the top navigation. This would have a button in the top left that slid both the tabGroup and itself (the top menu) to the right or left to reveal/hide the bottom "hidden" menu.
Sorry about the lengthy post! I also may be completely over-thinking this...If anyone wants me to do a mockup image of what I'm thinking, let me know and I'd be happy to.
Thanks,
Mike
1 Answer
Accepted Answer
Hi Michael
Have you considered that the app has no tabgroup and is simply a single for the main interface, with several views playing the part of what you consider windows inside tabs if it were a strictly traditional tabgroup app.
By using main layered views you can control the layout, particularly with the top left button revealing a 'hidden' view. The 'nav bar' at the top is most likely another view dressed up to appear as a standard 'nav bar', however by simply hiding and showing (and sliding) views in and out it all appears to be a standard nav bar.
The benefit of this method is as you state is that it appears to work visually well. The slight downside is that you have to manage the process of fake windows (actually views) sliding in and out rather than the built in ability of the tab group and nav controller.
Instead of considering the method to be 3 main windows, instead think 3 views, add them in the correct order and position them on and off screen for their ideal starting points.
A rough example structure would be;
// contains the search bar and tableview // which is hidden behind the main view var viewSections = Ti.UI.createScrollView({ contentHeight: Ti.UI.SIZE, contentWidth: Ti.UI.FILL, layout: 'vertical', showHorizontalScrollIndicator: true, showVerticalScrollIndicator: true }); win.add(viewSections); var search = Ti.UI.createSearchBar({ ... }); viewSections.add(search); var sections = [ { title: 'One' }, { title: 'Two' }, { title: 'Three' } ]; var tblSections = Ti.UI.createTableView({ data: data ... }); viewSections.add(data); // contains the main information you want to present // has the 'nav bar' at the top var viewMain = Ti.UI.createScrollView({ contentHeight: Ti.UI.SIZE, contentWidth: Ti.UI.FILL, layout: 'vertical', showHorizontalScrollIndicator: true, showVerticalScrollIndicator: true }); win.add(viewMain); var viewMain1 = Ti.UI.createView({ ... }); viewMain.add(viewMain1); var viewMain2 = Ti.UI.createView({ ... }); viewMain.add(viewMain2); // generix view used to show context information // with this you could swap info in and out as required // you could have several of these if you needed but be cautious // with memory usage var viewOther = Ti.UI.createScrollView({ contentHeight: Ti.UI.SIZE, contentWidth: Ti.UI.FILL, layout: 'vertical', showHorizontalScrollIndicator: true, showVerticalScrollIndicator: true }); win.add(viewOther); var viewImage = Ti.UI.createImageView({ ... }); viewOther.add(viewImage);
Your Answer
Think you can help? Login to answer this question!