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 211360 ccadeded76c42a477b7ebda31c527cabfb864047
parent 211359 566e8300d241cb5839a39dd3b56e9dd31c9d8f6f
child 211361 3b21becf8c2a5b0481ef73796edc8bc6569fe351
push id50691
push userkwierso@gmail.com
push dateTue, 21 Oct 2014 02:08:21 +0000
treeherdermozilla-inbound@0808729b24e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1055883
milestone36.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 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();