Notify when the viewport should be shrunk
- When the top controls is visible notify webkit the viewport
needs to be shrunk. When the top control is invisible the
viewport should not be shrunk.
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 01876a4..7070891 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -799,6 +799,10 @@
if (mWebViewController instanceof Controller) {
Controller controller = (Controller)mWebViewController;
controller.getUi().translateTitleBar(topControlsOffsetYPix);
+ // Resize the viewport if top controls is not visible
+ if (topControlsOffsetYPix == 0.0f || contentOffsetYPix == 0.0f)
+ ((BrowserWebView)mMainView).enableTopControls(
+ (topControlsOffsetYPix == 0.0f) ? true : false);
}
}