Not as a Native app, but just running inside the default browser on my Android phone this settings in app.js works fairly well:
Code:
viewport: {
autoMaximize: true
},
It does not seem to have any performance penalty.
It works when the app/web page is first loaded, and works on orientation change. It does not work when you navigate to a new URL and then press the back button.
The sencha code seems to confirm this. Only 2 cases were handled: (ready and orientationchange)
Code:
applyAutoMaximize: function(autoMaximize) {
if (Ext.browser.is.WebView) {
autoMaximize = false;
}
if (autoMaximize) {
this.on('ready', 'doAutoMaximizeOnReady', this, { single: true });
this.on('orientationchange', 'doAutoMaximizeOnOrientationChange', this);
}
else {
this.un('ready', 'doAutoMaximizeOnReady', this);
this.un('orientationchange', 'doAutoMaximizeOnOrientationChange', this);
}
return autoMaximize;
},
I suggest you add a handler for onDOMContentLoaded as that seems to be fired when the page is reloaded with the back arrow (and might also handle the case of the zoom level changing).