diff options
author | Leon Scroggins <scroggo@google.com> | 2009-09-02 21:12:08 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-09-03 14:08:53 -0400 |
commit | 0236e673d8b980fd6333c18505129c6b49e38cd1 (patch) | |
tree | 335340394830c354893c9a342ec20a9bdb57ccde /core/java/android/webkit/ViewManager.java | |
parent | 70fc625745b5c6303951113e6d17ea57870fe2f7 (diff) | |
download | frameworks_base-0236e673d8b980fd6333c18505129c6b49e38cd1.zip frameworks_base-0236e673d8b980fd6333c18505129c6b49e38cd1.tar.gz frameworks_base-0236e673d8b980fd6333c18505129c6b49e38cd1.tar.bz2 |
Attach the title bar to the top of the page.
Remove the old notions of changing the viewing mode
resulting in changing the visibility of the title bar.
Instead, attach the title bar to the top of the page.
Change contentToView() to contentToViewY() (and an X
version; same change for viewToContent), to account
for the title bar's height. Adjust the parameters
for drawing the scroll bar to account for the title bar.
Requires a change to packages/apps/Browser.
Change-Id: Ic0f7d6e0a1cce58ba2bca87337cf72a8194e9aa4
Diffstat (limited to 'core/java/android/webkit/ViewManager.java')
-rw-r--r-- | core/java/android/webkit/ViewManager.java | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/core/java/android/webkit/ViewManager.java b/core/java/android/webkit/ViewManager.java index af33b4f..63f4033 100644 --- a/core/java/android/webkit/ViewManager.java +++ b/core/java/android/webkit/ViewManager.java @@ -50,8 +50,8 @@ class ViewManager { } setBounds(x, y, width, height); final AbsoluteLayout.LayoutParams lp = - new AbsoluteLayout.LayoutParams(ctv(width), ctv(height), - ctv(x), ctv(y)); + new AbsoluteLayout.LayoutParams(ctvX(width), ctvX(height), + ctvX(x), ctvY(y)); mWebView.mPrivateHandler.post(new Runnable() { public void run() { // This method may be called multiple times. If the view is @@ -97,9 +97,21 @@ class ViewManager { return new ChildView(); } - // contentToView shorthand. - private int ctv(int val) { - return mWebView.contentToView(val); + /** + * Shorthand for calling mWebView.contentToViewX. Used when obtaining a + * view x coordinate from a content x coordinate, or when getting a + * view dimension from a content dimension, whether it be in x or y. + */ + private int ctvX(int val) { + return mWebView.contentToViewX(val); + } + + /** + * Shorthand for calling mWebView.contentToViewY. Used when obtaining a + * view y coordinate from a content y coordinate. + */ + private int ctvY(int val) { + return mWebView.contentToViewY(val); } void scaleAll() { @@ -107,10 +119,10 @@ class ViewManager { View view = v.mView; AbsoluteLayout.LayoutParams lp = (AbsoluteLayout.LayoutParams) view.getLayoutParams(); - lp.width = ctv(v.width); - lp.height = ctv(v.height); - lp.x = ctv(v.x); - lp.y = ctv(v.y); + lp.width = ctvX(v.width); + lp.height = ctvX(v.height); + lp.x = ctvX(v.x); + lp.y = ctvY(v.y); view.setLayoutParams(lp); } } |