Bug 1076692 - Account for statusbar height when tint is enabled (r=mfinkle)
authorLucas Rocha <lucasr@lucasr.org>
Thu, 09 Oct 2014 20:03:41 +0100
changeset 209701 d0a4eacacc458cba047fac48f8e94b75a893d4df
parent 209700 ab841eff16db861d868057c38060d354beabc751
child 209702 8f632f1754a79635397bde0eecbcaea8b0340e57
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs1076692
milestone35.0a1
Bug 1076692 - Account for statusbar height when tint is enabled (r=mfinkle)
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2371,16 +2371,21 @@ public class BrowserApp extends GeckoApp
 
             // We need to account for scroll state for the touched view otherwise
             // tapping on an "empty" part of the view will still be considered a
             // valid touch event.
             if (view.getScrollX() != 0 || view.getScrollY() != 0) {
                 view.getHitRect(mTempRect);
                 mTempRect.offset(-view.getScrollX(), -view.getScrollY());
 
+                if (mTintManager != null) {
+                    SystemBarTintManager.SystemBarConfig config = mTintManager.getConfig();
+                    mTempRect.offset(0, -config.getPixelInsetTop(false));
+                }
+
                 int[] viewCoords = new int[2];
                 view.getLocationOnScreen(viewCoords);
 
                 int x = (int) event.getRawX() - viewCoords[0];
                 int y = (int) event.getRawY() - viewCoords[1];
 
                 if (!mTempRect.contains(x, y))
                     return false;