[ 
https://issues.apache.org/jira/browse/CB-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105930#comment-15105930
 ] 

Joe Bowser commented on CB-10378:
---------------------------------

I can reproduce this with both Crosswalk and the Android WebView, but I think 
this is a Chromium/Android bug that we really have very little control over, or 
is something that would be technically expensive to fix.

It seems that when you restore an application, the WebView is rendered in 
portrait, then resized to landscape and the screen.availWidth and 
screen.availHeight values aren't updated.  This is really irritating, but 
without messing with the WebView initialization, we can't do anything about 
this.  I think forcing the WebView to reset its state after we restore it would 
cause a lot more problems, which is why I don't want to do it in this case.

I would recommend using window.innerHeight and window.innerWidth, since unlike 
screen.width or screen.availWidth.  I don't see any distortions on the screen 
suggesting that the application viewport is rendered a the wrong scale, so it 
appears that it's just the values that are screwed up.



> Viewport dimensions swapped after app restore in Android
> --------------------------------------------------------
>
>                 Key: CB-10378
>                 URL: https://issues.apache.org/jira/browse/CB-10378
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 5.4.1
>         Environment: Cordova Android 4.1.1 or 5.0.0
>            Reporter: Mathijs
>
> h1. Steps to reproduce
> 1. Assure {{<preference name="Orientation" value="landscape" />}} in 
> {{config.xml}}
> 2. (Clean) start the app
> 3. Press the back button
> 4. Open the app switcher
> 5. Select the app
> h1. Expected behaviour
> As the app is started the measurements.js code dumps {{screen.availWidth}} 
> and {{screen.availHeight}}. When restoring it after pressing the back button, 
> the app initializes again and the same values should be displayed.
> h1. Perceived behaviour
> The values for {{screen.availWidth}} and {{screen.availHeight}} are swapped. 
> This causes the app's viewport to be renedered at the wrong scale.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to