Bug 1055883 - Don't reshow header when hitting the bottom of short pages. r=kats
authorWes Johnston <wjohnston@mozilla.com>
Tue, 14 Oct 2014 14:29:00 -0700
changeset 211264 ccadeded76c42a477b7ebda31c527cabfb864047
parent 211263 566e8300d241cb5839a39dd3b56e9dd31c9d8f6f
child 211265 3b21becf8c2a5b0481ef73796edc8bc6569fe351
push id9464
push userwjohnston@mozilla.com
push dateMon, 20 Oct 2014 18:03:26 +0000
treeherderfx-team@ccadeded76c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1055883
milestone36.0a1
Bug 1055883 - Don't reshow header when hitting the bottom of short pages. r=kats
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1205,22 +1205,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();