Results 1 to 4 of 4

Thread: Android is resizing the viewport

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2010
    Posts
    23
    Answers
    1

    Question Answered: Android is resizing the viewport

    Hello,

    I am developing a complex application with ExtJS 4.1.3 which must be usable on desktop and on tablets. (I know there is Sencha Touch but I don't want to develop 2 applications).

    Everything works fine except that the android keyboard is shrinking the layout of the viewport. Thus, many recalculations of the layout are taking place.

    Is there any possibility to avoid the shrinking of the viewport while using the android browser?

    With best thanks
    Saskia

  2. I actually found the same solution, ettavolt.
    Here is my code:
    PHP Code:
    fireResize : function(widthheight){
            if( 
    navigator.userAgent.indexOf("Android") >= || navigator.userAgent.indexOf("iP") >= 0) {
                if(
    width === this.width)
                    return 
    false;
                else
                    
    this.setSize(widthheight);
            } else {
                if (
    width != this.width || height != this.height) {
                    
    this.setSize(widthheight);
                }
            }
        } 

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    I am not sure if there is anything you can do about this. You would have to detect the loading of the KB .. I have not tried this in Ext.

    Scott.

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    574
    Answers
    59

    Default

    Under similar circumstances I've modified fireResize method to prevent shrinking in one dimension if not expanding in other (to allow orientation change).

  5. #4
    Sencha Premium Member
    Join Date
    Jul 2010
    Posts
    23
    Answers
    1

    Default

    I actually found the same solution, ettavolt.
    Here is my code:
    PHP Code:
    fireResize : function(widthheight){
            if( 
    navigator.userAgent.indexOf("Android") >= || navigator.userAgent.indexOf("iP") >= 0) {
                if(
    width === this.width)
                    return 
    false;
                else
                    
    this.setSize(widthheight);
            } else {
                if (
    width != this.width || height != this.height) {
                    
    this.setSize(widthheight);
                }
            }
        } 

Posting Permissions

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