Bug 1394879 - Replaced TouchDelegate usage with TouchDelegateWithReset .r=JanH
authorsuneet <suneetbond91@gmail.com>
Thu, 14 Sep 2017 01:45:19 +0530
changeset 430283 95bcc263da5e74f605a9694427e29d970dade05a
parent 430282 f2d3bce7e6dc49171bda39be7302b5997c591f66
child 430284 b22037b06fb65d176045065ee4c791d6ac016b30
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJanH
bugs1394879
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1394879 - Replaced TouchDelegate usage with TouchDelegateWithReset .r=JanH MozReview-Commit-ID: 4pTiOXAUkp0
mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
mobile/android/base/java/org/mozilla/gecko/util/TouchTargetUtil.java
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
@@ -8,25 +8,25 @@ package org.mozilla.gecko.tabs;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.StateListDrawable;
 import android.graphics.Rect;
 import android.support.annotation.UiThread;
 import android.support.v4.content.ContextCompat;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
-import android.view.TouchDelegate;
 import android.view.View;
 import android.view.ViewTreeObserver;
 
 import org.mozilla.gecko.BrowserApp.TabStripInterface;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.mma.MmaDelegate;
+import org.mozilla.gecko.widget.TouchDelegateWithReset;
 import org.mozilla.gecko.widget.themed.ThemedImageButton;
 import org.mozilla.gecko.widget.themed.ThemedLinearLayout;
 
 import static org.mozilla.gecko.mma.MmaDelegate.NEW_TAB;
 
 
 public class TabStrip extends ThemedLinearLayout
                       implements TabStripInterface {
@@ -75,17 +75,17 @@ public class TabStrip extends ThemedLine
                     final Rect r = new Rect();
                     r.left = addTabButton.getRight();
                     r.right = getWidth();
                     r.top = 0;
                     r.bottom = getHeight();
 
                     // Redirect touch events between the 'new tab' button and the edge
                     // of the screen to the 'new tab' button.
-                    setTouchDelegate(new TouchDelegate(r, addTabButton));
+                    setTouchDelegate(new TouchDelegateWithReset(r, addTabButton));
 
                     return true;
                 }
             });
 
         tabsListener = new TabsListener();
     }
 
--- a/mobile/android/base/java/org/mozilla/gecko/util/TouchTargetUtil.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/TouchTargetUtil.java
@@ -5,16 +5,17 @@
 
 package org.mozilla.gecko.util;
 
 import android.graphics.Rect;
 import android.view.TouchDelegate;
 import android.view.View;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.widget.TouchDelegateWithReset;
 
 public class TouchTargetUtil {
     /**
      * Ensures that a given targetView has a large enough touch area to ensure it can be selected.
      * A TouchDelegate will be added to the enclosingView as necessary.
      *
      * @param targetView
      * @param enclosingView
@@ -35,14 +36,14 @@ public class TouchTargetUtil {
                 final int heightDelta = (targetHitArea - delegateArea.height()) / 2;
                 delegateArea.bottom += heightDelta;
                 delegateArea.top -= heightDelta;
 
                 if (heightDelta <= 0 && widthDelta <= 0) {
                     return;
                 }
 
-                TouchDelegate touchDelegate = new TouchDelegate(delegateArea, targetView);
+                TouchDelegate touchDelegate = new TouchDelegateWithReset(delegateArea, targetView);
                 enclosingView.setTouchDelegate(touchDelegate);
             }
         });
     }
 }