]> source.dussan.org Git - vaadin-framework.git/commitdiff
Removed duplicate code for broken Android detection (#8716)
authorArtur Signell <artur.signell@itmill.com>
Thu, 26 Apr 2012 13:11:51 +0000 (13:11 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 26 Apr 2012 13:11:51 +0000 (13:11 +0000)
svn changeset:23643/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java
src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java

index 96cb4b8a3533a96f81940a2fbc72332202952a07..460c474e66dad0c05f8b00cfbde7042501d921ab 100644 (file)
@@ -24,7 +24,6 @@ import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.gwt.user.client.ui.impl.FocusImpl;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
-import com.vaadin.terminal.gwt.client.VConsole;
 
 /**
  * A scrollhandlers similar to {@link ScrollPanel}.
@@ -163,7 +162,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements
      *            the new vertical scroll position, in pixels
      */
     public void setScrollPosition(int position) {
-        if (isAndroidWithBrokenScrollTop()) {
+        if (BrowserInfo.get().isAndroidWithBrokenScrollTop()) {
             ArrayList<com.google.gwt.dom.client.Element> elements = TouchScrollDelegate
                     .getElements(getElement());
             for (com.google.gwt.dom.client.Element el : elements) {
@@ -177,11 +176,6 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements
         }
     }
 
-    private boolean isAndroidWithBrokenScrollTop() {
-        return BrowserInfo.getBrowserString().contains("Android 3")
-                || BrowserInfo.getBrowserString().contains("Android 4");
-    }
-
     public void onScroll(ScrollEvent event) {
         Scheduler.get().scheduleDeferred(new ScheduledCommand() {
             public void execute() {
index d4b59ed23ab955c2c607b80ff08a613ddb68e2d1..8b2248aff687e540e386f7ff3480170a0cddd064 100644 (file)
@@ -83,9 +83,8 @@ public class TouchScrollDelegate implements NativePreviewHandler {
 
     private static TouchScrollDelegate activeScrollDelegate;
 
-    private static final boolean androidWithBrokenScrollTop = BrowserInfo
-            .getBrowserString().contains("Android 3")
-            || BrowserInfo.getBrowserString().contains("Android 4");
+    private static final boolean androidWithBrokenScrollTop = BrowserInfo.get()
+            .isAndroidWithBrokenScrollTop();
 
     public TouchScrollDelegate(Element... elements) {
         scrollableElements = elements;