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.
  1. #11
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    770
    Vote Rating
    28
    Steffen Hiller will become famous soon enough Steffen Hiller will become famous soon enough

      0  

    Default


    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.

  2. #12
    Sencha User
    Join Date
    Feb 2012
    Posts
    20
    Vote Rating
    3
    bstrappazzon is on a distinguished road

      0  

    Default


    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
    Code:
    Ext.application({
        name: 'myApp',
        isIconPrecomposed: false,
        requires: [
            'myApp.override.viewport.Android',
            'Ext.MessageBox',
        'myApp.view.Toolbar',
        'Ext.NavigationView'
        ],
        views: ['home.Home',
    ...
    I get the following error
    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

  3. #13
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    770
    Vote Rating
    28
    Steffen Hiller will become famous soon enough Steffen Hiller will become famous soon enough

      0  

    Default


    You need:
    Ext.define('myApp.override.viewport.Android', {

    instead of:
    Ext.define('App.override.viewport.Android', {

  4. #14
    Sencha User
    Join Date
    Feb 2012
    Posts
    20
    Vote Rating
    3
    bstrappazzon is on a distinguished road

      0  

    Default


    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

  5. #15
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    6
    Bloodyaugust is on a distinguished road

      0  

    Default


    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.

  6. #16
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    6
    Bloodyaugust is on a distinguished road

      0  

    Default


    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.

  7. #17
    Sencha User debianw's Avatar
    Join Date
    Mar 2012
    Location
    Costa Rica
    Posts
    49
    Vote Rating
    2
    debianw is on a distinguished road

      0  

    Default


    Quote Originally Posted by Bloodyaugust View Post
    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.
    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.

  8. #18
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    6
    Bloodyaugust is on a distinguished road

      0  

    Default


    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.

  9. #19
    Sencha User debianw's Avatar
    Join Date
    Mar 2012
    Location
    Costa Rica
    Posts
    49
    Vote Rating
    2
    debianw is on a distinguished road

      0  

    Default


    Quote Originally Posted by Bloodyaugust View Post
    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.
    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

  10. #20
    Sencha User
    Join Date
    Feb 2010
    Posts
    355
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    Hello i have applied this patch in ST 2.1.1 , and checked with an alert() show message to ensure it is loaded.

    but in Android 2.2 when keyboard is loaded, then closed, and the viewport height stills wrong.
    this patch don't work in my case.

    Manel
    -------------------
    Manel Juàrez