question

robin avatar image
robin asked

Screen width rendering anomaly using new Amazon WebView

Using the Amazon WebView awv_interface.jar file now renders a gutter on the left and right sides in landscape mode [1] A Html5 page filled the entire screen in both width and height, in landscape and portrait modes, for both the ver 2 Web App Tester and a hybrid app Kindle OS 7.4.6 using the Amazon WebView in the WAT without the new Amazon WebView awv_interface.jar file included. Compiling the same using the awv_interface.jar and mods as indicated now render a margin gutter. [1] I also note that touch-drag is erroneously applied to the body background, whereas before it was correctly blocked. Note that I do need to perform more CSS testing on this single item. The viewport element is: meta name="viewport" content="width=device-width,initial-scale=1.0" and I've tried the suggestion using the 'content' attribute for 'user-scalable' testing in several mode variants with no luck meta name="viewport" content="user-scalable=no" [2] Have attempted to add this to the manifest with no change, e.g. still doesn't fill width [3] supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" android:requiresSmallestWidthDp="533" Using this snippet inside MainActivity Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y; I have been able to confirm the KF HD7 device 'sees' 1280x800 as the specs indicate it should. [3] But, when I attempt the same using Javascript window.screen yields: availHeight: 853 availLeft: 0 availTop: 0 availWidth: 533 colorDepth: 32 height: 853 pixelDepth: 32 width: 533 Also testing inside Silk shows the same above values. 854x534 The math here doesn't add up either. The documentation isn't definitive in actual useable screen dimensions [3] Subtracting out the soft key bar width and subtracting what Javascript window.screen detects status bar 35 soft key 78 1280 x 800 1280 - 78 = 1202 - 853 = 349 / 2 = 175 853 in landscape mode, there are (calculated) 175px missing from the left and another 175px from the right but visually appears to be only around 50px or so missing either side. Side note: what is the useable area as there appears to be 150-200+ pixels unaccounted for? What is curious is that windows.screen detects the same '533' value that is suggested to use in the AndroidManifest.xml file for the 'supports-screens' element and the 'requiresSmallestWidthDp="533"' attribute value, but that isn't '853' which is what is expected when calculated and what is seen by Javascript windows.screen. Any ideas why the new Amazon WebView inserts these gutters and steps to prevent? I also note that there has been a Kindle OS upgrade to 7.4.9 from 7.4.6 Robin [1] https://developer.amazon.com/sdk/fire/IntegratingAWV.html [2] https://developer.amazon.com/appsandservices/solutions/platforms/webapps/docs/best-practices.html [3] https://developer.amazon.com/appsandservices/solutions/devices/kindle-fire/app-development/01--screen-layout-and-resolution
web apps
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Robin, I tested couple of pages in Web app tester and AWV hybrid view. I did not understand which gutter you are referring to? Can you provide a screen shot and the page that reproduce the gutter or margin gutter? It would helpful for me to understand the issue. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.