1. #1
    Sencha User
    Join Date
    May 2013
    Location
    Rovereto
    Posts
    7
    Vote Rating
    0
    emanuele.vendra is on a distinguished road

      0  

    Default Keyboard on Android O.S. resizes the view

    Keyboard on Android O.S. resizes the view


    Hello,
    I have develop an application whit sencha touch 2.1, on O.S. Android, when i go to insert any field (the when keyboard appears), the keyboard resizes the view, making it inusable the application.

    Any solutions for me??
    Thank's and have a nice day.

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,967
    Vote Rating
    133
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    In what version of Android are you experiencing this issue. Is this a web app or a native app? If native app was it packaged with Sencha native packager or phonegap?

  3. #3
    Sencha User
    Join Date
    May 2013
    Location
    Rovereto
    Posts
    7
    Vote Rating
    0
    emanuele.vendra is on a distinguished road

      0  

    Default Android version

    Android version


    I tried on Android 4.1.2 and in 4.0.4 version. My app is a WebApp.

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,967
    Vote Rating
    133
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    What version of 2.1.x are you using? I was to reproduce in 2.1.0 but not 2.1.1.

  5. #5
    Sencha User
    Join Date
    May 2013
    Location
    Rovereto
    Posts
    7
    Vote Rating
    0
    emanuele.vendra is on a distinguished road

      0  

    Default


    I'm using Sencha touch 2.1.1 version. If I don't fix this problem the App is virtually inusable in a form panel view.

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,967
    Vote Rating
    133
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Give this override a try:
    Code:
    Ext.define('overrides.Ext.viewport.Android', {
        override: 'Ext.viewport.Android',
        config: {
            autoBlurInput: true
        },
        supportsOrientation: function () {
            return false;
        },
        onResize: function () {
            this.waitUntil(function () {
                var oldWidth = this.windowWidth,
                    oldHeight = this.windowHeight,
                    width = this.getWindowWidth(),
                    height = this.getWindowHeight(),
                    currentOrientation = this.getOrientation(),
                    newOrientation = this.determineOrientation();
                return ((oldWidth !== width && oldHeight !== height) && currentOrientation !== newOrientation);
            }, function () {
                var currentOrientation = this.getOrientation(),
                    newOrientation = this.determineOrientation();
                this.fireOrientationChangeEvent(newOrientation, currentOrientation);
            }, Ext.emptyFn, 250);
        },
        doPreventZooming: function (e) {
            // Don't prevent right mouse event
            if ('button' in e && e.button !== 0) {
                return;
            }
            var target = e.target;
            if (target && target.nodeType === 1 && !this.isInputRegex.test(target.tagName) && !this.focusedElement) {
                e.preventDefault();
            }
        },
        doFixSize: Ext.emptyFn
    });

Thread Participants: 1

Tags for this Thread