-
19 Nov 2012 8:19 AM #11
You need to override here, won't work if just add it to your viewport.
So create a folder "override" in your app folder and in it a folder "viewport".
Then put the above code in an Android.js file and adjust the app namespace:
Ext.define('App.override.viewport.Android', {
Then add 'myApp.override.viewport.Android' in the requires array in your app.js file.
You can add a alert message in the doFix method to make sure it's called on your Android device.Owner of 360releases Ltd. - Sencha Touch & Ext JS consulting
twitter.com/steffenhiller
extjswithrails.com, senchatouchbits.com
-
19 Nov 2012 9:23 AM #12
This is still not working,
Are you sure I have to define the overriden viewport with a capital letter in App
as my app folder in not in capital letter.
I do exactly what you tell :- add an Android.js in app/override/viewport/ with this signature
Code:Ext.define('App.override.viewport.Android', { override: 'Ext.viewport.Android', lastHeight: 0, orientationChanged: false, ...- Add this to my Ext.application in app.js
I get the following errorCode:Ext.application({ name: 'myApp', isIconPrecomposed: false, requires: [ 'myApp.override.viewport.Android', 'Ext.MessageBox', 'myApp.view.Toolbar', 'Ext.NavigationView' ], views: ['home.Home', ...
The following classes are not declared even if their files have been loaded:
'myApp.override.viewport.Android'. Please check the source code of their corresponding files for possible typos: 'app/override/viewport/Android.js
Do you see something wrong in my code?
Thanks
Benjamin
-
19 Nov 2012 9:25 AM #13
You need:
Ext.define('myApp.override.viewport.Android', {
instead of:
Ext.define('App.override.viewport.Android', {Owner of 360releases Ltd. - Sencha Touch & Ext JS consulting
twitter.com/steffenhiller
extjswithrails.com, senchatouchbits.com
-
19 Nov 2012 11:59 PM #14
Hi Steffen,
It's still not working. I don't understand how to override this android viewport.
I don't have the error message anymore but I had an alert in doFix and it doesn't show up.
Is there something missing to override the viewport?
Tanks
Benjamin
-
8 Mar 2013 10:48 AM #15
Has there been any progress on this bug? It has been here since August of last year, and a canon fix here would be extremely useful.
-
11 Mar 2013 8:16 AM #16
Double post, but we have a fix:
Thanks to this post, we looked into the source and found the pertinent Sencha code that was released to fix it. Using those changes, we were able to fix the problem for pre-4 Android.
-
26 Mar 2013 8:50 AM #17
Hey Bloodyaugust,
What is your fix ?. I'm having the same issue after taking a picture using Cordova 2.4. Seems Android is not getting the correct feedback dimensions and reports a wrong height. After taking a pic there's a switch between landscape to portrait, then a resume event is fired in order to get the App to the front, then Sencha fix the layout to be rendered in portrait but with an incorrect height.
-
26 Mar 2013 10:01 AM #18
Check out the most recent beta build, and look inside the Android Viewport code. Sencha added a listener there, just copy over that change to your Viewport.
-
26 Mar 2013 10:33 AM #19
I did that a month ago, but that didn't work for me. There's a problem with the Cordova webview reporting the correct dimensions width and height after a resume event, lets say after a sleep or after take a picture or after a barcode scanning. Anything the puts the app in the back and then put it back to the front.
I'm using:
* Cordova 2.4
* Android SDK 4.1
* Sencha Touch 2.0
You found a bug! We've classified it as
TOUCH-3364
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote