Bug 1055883 - Don't reshow header when hitting the bottom of short pages. r=kats

This commit is contained in:
Wes Johnston 2014-10-14 14:29:00 -07:00
parent ca9b6baec8
commit 20c90d0a19

View File

@ -1210,12 +1210,13 @@ public class BrowserApp extends GeckoApp
// 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);