From b771e1989377387bfcb40f1ac1d217baa1236766 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 26 Apr 2012 13:11:51 +0000 Subject: [PATCH] Removed duplicate code for broken Android detection (#8716) svn changeset:23643/svn branch:6.8 --- .../terminal/gwt/client/ui/FocusableScrollPanel.java | 8 +------- .../terminal/gwt/client/ui/TouchScrollDelegate.java | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java index 96cb4b8a35..460c474e66 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java @@ -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 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() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java index d4b59ed23a..8b2248aff6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java @@ -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; -- 2.39.5