Hi there
I'm dealing with my little experience in titanium to develop a system similar to the iphone has its "NavigationWindow" navigation.
Well try to explain what my problem is and see if anyone could help me with some code.
Well ... if they see I have a file "navigationWindow.js" I call on several other files containing all the windows belonging to the application. All these files are'm trying as modules.
function navigationWindow(_args) { var winSesion = require('window/winSesion'), winBranche = require('window/winBranche'), winTypeForm = require('window/winTypeForm'), winForm = require('window/winForm'); var sesionWindow = new winSesion({ widthx: _args.widthx }); sesionWindow.open(); //alert(_args.widthx); var btnNextHandler = function (e) { var win = winBranche.create({ title:'Sucursales', widthx: _args.widthx, side: _args.widthx }); win.open(); new navigation(0,win,'left','open'); new navigation(-_args.widthx,sesionWindow,'left','close'); }; var winCloseHandler = function (e) { Ti.App.removeEventListener('btnNext', btnNextHandler); sesionWindow.removeEventListener('close', winCloseHandler); }; Ti.App.addEventListener('btnNext', btnNextHandler); sesionWindow.addEventListener('close', winCloseHandler); var navigation = function(side,win,flip,action) { var animation = Ti.UI.createAnimation(); switch(flip) { case 'left': var delay = (action==='close') ? 100 : 0; animation.left = side; animation.delay = delay; break; case 'right': animation.right = side; break; }; animation.duration = 300; win.animate(animation); }; }; module.exports = navigationWindow;This is the code that I have for now .... each window
function winSesion(obj) { var win = Ti.UI.createWindow({ backgroundColor:'white', width:obj.widthx }); var btn = Ti.UI.createButton({ title:Ti.Platform.displayCaps.platformWidth, width:'100%', //color:'#222', backgroundColor:'#eee', height:'80dp', bottom:0, font:{ fontFamily:'ubuntu', fontSize:25 } }); win.add(btn); btn.addEventListener('click',function() { Ti.App.fireEvent('btnNext'); }); return win; }; module.exports = winSesion;Well, go into detail.
I am creating a NavigationWindow module that calls other modules, which would be the windows of my application. And I think a class that will contain ele effect slideshow for each window. Also I have a file that have config.js width "Ti.Platform.displayCaps.platformWidth" then these I pass as a parameter to each file.
Here goes one of my biggest problems. that's when I turn to the second window, the width of "this window (second window)" is wider. The first window perfectly making the "Ti.Platform.displayCaps.platformWidth" but the problem is when I move to the second window is no longer the same width.
Someone can help me to develop a good navigation system.
Thank you