json - How to make a mobile app screen size aware -
json - How to make a mobile app screen size aware -
i want create cordova (phonegap) app can used on devices. including pc screens. want layout adjust number , layout of panels (views) acording simple instructions. chose dojox.app because of way config.json file controls mvc construction of app.
a dojox.app uses controllers handle size , orientation events. config.json file contains "controllers", "views" , other elements define mvc construction of app
//mandatory,listen app.emit events,implement dojox/app/controller "controllers": [ //listens "app-init, app-load" "dojox/app/controllers/load", //listens "app-transition, app-domnode" "dojox/app/controllers/transition", //listens "app-initlayout,app-layoutview,app-resize" "dojox/app/controllers/layout" ], //mandatory, 1 or set of views view1+view2+view3 "defaultview": "home+rightpane", //mandatory, specify application kid views "views": { "home":{ //mandatory set template defaultviews "template": "app/views/home/home.html", "controller" : "app/views/home/home.js", "defaultview": "rightpane", /* when transitioning between tabs, utilize flip animation default */ "defaulttransition": "slide", /* views available scene */ "views": { "rightpane":{ //mandatory set template defaultviews "template": "app/views/rightpane/right.html", "controller" : "app/views/rightpane/right.js", "defaultview": "general", /* when transitioning between tabs, utilize flip animation default */ "defaulttransition": "slide", /* views available scene */ "views": { "about":{ "template": "app/views/about/about.html", "controller" : "app/views/about/view.js" }, "wifi":{ "template": "app/views/wifi/wifi.html", "controller" : "app/views/wifi/wifi.js" }, "general":{ "template": "app/views/general/general.html", "controller" : "app/views/general/general.js" }, "picture":{ "template": "app/views/picture/picture.html", "controller" : "app/views/picture/picture.js" }, "bright":{ "template": "app/views/bright/bright.html", "controller" : "app/views/bright/bright.js" } } } } } }, ...
i want create custom controller changeing "dojox/app/controllers/layout"
allow add-on , subtraction of views depending on screen sizs.
dojo has experimental 'dojox/mobile/screensizeaware'
module limited 2 panels , not work (well haven't been able to) in mvc environment.
how go defining views in config.json file , how create controller.
i'll give serious thought on next few days. if have suggestions please jot them downwards here.
you should take @ dojox/app/tests/mediaquery3columnapp, show 1, 2 or 3 columns depending upon screen size. includes custom layout controller uses css handle layout, , custom navigation controller seek handle views show when transitioning. not perfect, there issues navigation between views when displayed columns has changed, should started. can run here: http://archive.dojotoolkit.org/nightly/checkout/dojox/app/tests/mediaquery3columnapp/ , can see code here: https://github.com/dmachi/dojox_application/tree/master/tests/mediaquery3columnapp
regards, ed
json mobile layout dojo
Comments
Post a Comment