Bug 1055883 - Don't reshow header when hitting the bottom of short pages. r=kats, a=lmandel
authorWes Johnston <wjohnston@mozilla.com>
Tue, 14 Oct 2014 14:29:00 -0700
changeset 225798 823ecd23138b
parent 225797 033942f8f817
child 225799 eed6613c5568
push id4021
push userryanvm@gmail.com
push date2014-10-24 13:05 +0000
treeherdermozilla-beta@b185e7a13e18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, lmandel
bugs1055883
milestone34.0
Bug 1055883 - Don't reshow header when hitting the bottom of short pages. r=kats, a=lmandel
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1120,22 +1120,23 @@ public class BrowserApp extends GeckoApp
     @Override
     public void onPanZoomStopped() {
         if (!mDynamicToolbar.isEnabled() || isHomePagerVisible()) {
             return;
         }
 
         // Make sure the toolbar is fully hidden or fully shown when the user
         // lifts their finger. If the page is shorter than the viewport or if
-        // the user has reached the end of the page, the toolbar is always
-        // shown.
+        // the user has reached the end of a long (longer than twice the viewport height) page,
+        // the toolbar is always shown.
         ImmutableViewportMetrics metrics = mLayerView.getViewportMetrics();
+        final float height = metrics.viewportRectBottom - metrics.viewportRectTop;
         if (metrics.getPageHeight() < metrics.getHeight()
               || metrics.marginTop >= mToolbarHeight / 2
-              || metrics.pageRectBottom == metrics.viewportRectBottom) {
+              || (metrics.pageRectBottom == metrics.viewportRectBottom && metrics.pageRectBottom > 2*height)) {
             mDynamicToolbar.setVisible(true, VisibilityTransition.ANIMATE);
         } else {
             mDynamicToolbar.setVisible(false, VisibilityTransition.ANIMATE);
         }
     }
 
     public void refreshToolbarHeight() {
         ThreadUtils.assertOnUiThread();