Results 1 to 5 of 5

Thread: Sencha Touch 2.0.1.1 does not respect WebView resize

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default Sencha Touch 2.0.1.1 does not respect WebView resize

    I'm trying to add AdMob ads to android.

    When the ad loads, it covers up the bottom of my application. If I switch the orientation, everything re-renders correctly. This must mean that the WebView is the right size, but Sencha Touch isn't respecting the size change, right?

    Is this a known issue? Is there any way to fix this?

    This override was suggested around the internet, but it doesn't do anything:

    Code:
    Ext.define('Ext.viewport.Override', {
        override: 'Ext.viewport.Default',
        onResize: function () {
            var oldWidth = this.windowWidth,
                oldHeight = this.windowHeight,
                width = this.getWindowWidth(),
                height = this.getWindowHeight(),
                currentOrientation = this.getOrientation(),
                newOrientation = this.determineOrientation();
    
    
            if (oldWidth !== width || oldHeight !== height || currentOrientation !== newOrientation) {
                this.fireOrientationChangeEvent(newOrientation, currentOrientation);
            }
        }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,699
    Vote Rating
    1279
      0  

    Default

    Have you tried a newer release to see if bug fixes haven't fixed it?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default

    Generally upgrading ST breaks my application, but I'll see if I can't get it booting to test the ad resize.

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default

    Attempting to load ads in 2.2b1 causes the entire app to freeze and trigger the "App is not responding. Would you like to close it?" prompt.

    Is there any way I can watch for a WebView resize and trigger an orientation change manually?

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default

    This is a crap hack, but it works.

    Code:
        app.WINDOW_HEIGHT = window.innerHeight;
        setInterval(function () {
            if (app.WINDOW_HEIGHT !== window.innerHeight) {
                app.WINDOW_HEIGHT = window.innerHeight;
                Ext.Viewport.fireEvent('orientationchange');
            }
        }, 500);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •