Permalink
Browse files

Chrome For Android bug workaround.

  • Loading branch information...
1 parent 4c95a66 commit c138b79d228f266a79b3e1059e0d717cb3059574 @dennisjzh committed Apr 16, 2012
Showing with 9 additions and 1 deletion.
  1. +4 −1 src/com/gwtmobile/ui/client/page/Page.java
  2. +5 −0 src/com/gwtmobile/ui/client/utils/Utils.java
@@ -216,7 +216,10 @@ private static void setPageResolution() {
Document.get().getDocumentElement().setClassName("WVGA");
} else if (ratio == 0.75) {
Document.get().getDocumentElement().setClassName("QVGA");
- } else {
+ } else if (ratio == 1 && Utils.isMobileChrome()) { //Chrome for Android bug?
+ Document.get().getDocumentElement().setClassName("WXGA");
+ }
+ else {
Document.get().getDocumentElement().setClassName("HVGA");
}
}
@@ -104,6 +104,11 @@ public static boolean isAndroid() {
return Window.Navigator.getUserAgent().contains("Android");
}
+ public static boolean isMobileChrome() {
+ return isAndroid() &&
+ Window.Navigator.getUserAgent().contains("CrMo");
+ }
+
public static boolean isIOS() {
String ua = Window.Navigator.getUserAgent();
return ua.contains("iPhone") ||

0 comments on commit c138b79

Please sign in to comment.