Loading core/java/android/webkit/WebView.java +23 −3 Original line number Diff line number Diff line Loading @@ -2322,6 +2322,11 @@ public class WebView extends AbsoluteLayout */ private View mTitleBar; /** * the title bar rendering gravity */ private int mTitleGravity; /** * Add or remove a title bar to be embedded into the WebView, and scroll * along with it vertically, while remaining in view horizontally. Pass Loading @@ -2342,6 +2347,16 @@ public class WebView extends AbsoluteLayout mTitleBar = v; } /** * Set where to render the embedded title bar * NO_GRAVITY at the top of the page * TOP at the top of the screen * @hide */ public void setTitleBarGravity(int gravity) { mTitleGravity = gravity; } /** * Given a distance in view space, convert it to content space. Note: this * does not reflect translation, just scaling, so this should not be called Loading Loading @@ -3683,7 +3698,12 @@ public class WebView extends AbsoluteLayout // When drawing the title bar, move it horizontally to always show // at the top of the WebView. mTitleBar.offsetLeftAndRight(mScrollX - mTitleBar.getLeft()); int newTop = Math.min(0, mScrollY); int newTop = 0; if (mTitleGravity == Gravity.NO_GRAVITY) { newTop = Math.min(0, mScrollY); } else if (mTitleGravity == Gravity.TOP) { newTop = mScrollY; } mTitleBar.setBottom(newTop + getTitleHeight()); mTitleBar.setTop(newTop); } Loading Loading
core/java/android/webkit/WebView.java +23 −3 Original line number Diff line number Diff line Loading @@ -2322,6 +2322,11 @@ public class WebView extends AbsoluteLayout */ private View mTitleBar; /** * the title bar rendering gravity */ private int mTitleGravity; /** * Add or remove a title bar to be embedded into the WebView, and scroll * along with it vertically, while remaining in view horizontally. Pass Loading @@ -2342,6 +2347,16 @@ public class WebView extends AbsoluteLayout mTitleBar = v; } /** * Set where to render the embedded title bar * NO_GRAVITY at the top of the page * TOP at the top of the screen * @hide */ public void setTitleBarGravity(int gravity) { mTitleGravity = gravity; } /** * Given a distance in view space, convert it to content space. Note: this * does not reflect translation, just scaling, so this should not be called Loading Loading @@ -3683,7 +3698,12 @@ public class WebView extends AbsoluteLayout // When drawing the title bar, move it horizontally to always show // at the top of the WebView. mTitleBar.offsetLeftAndRight(mScrollX - mTitleBar.getLeft()); int newTop = Math.min(0, mScrollY); int newTop = 0; if (mTitleGravity == Gravity.NO_GRAVITY) { newTop = Math.min(0, mScrollY); } else if (mTitleGravity == Gravity.TOP) { newTop = mScrollY; } mTitleBar.setBottom(newTop + getTitleHeight()); mTitleBar.setTop(newTop); } Loading