Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0236e673 authored by Leon Scroggins's avatar Leon Scroggins
Browse files

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
parent 70fc6257
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -176,17 +176,6 @@ class CallbackProxy extends Handler {
        return mBackForwardList;
    }

    /**
     * Tell the host application that the WebView has changed viewing modes.
     * @param newViewingMode  One of the values described in WebView as possible
     *                        values for the viewing mode
     */
    /* package */ void uiOnChangeViewingMode(int newViewingMode) {
        if (mWebChromeClient != null) {
            mWebChromeClient.onChangeViewingMode(mWebView, newViewingMode);
        }
    }

    /**
     * Called by the UI side.  Calling overrideUrlLoading from the WebCore
     * side will post a message to call this method.
+21 −9
Original line number Diff line number Diff line
@@ -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);
        }
    }
+0 −9
Original line number Diff line number Diff line
@@ -22,15 +22,6 @@ import android.view.View;

public class WebChromeClient {

    /**
     * Tell the host application that the WebView has changed viewing modes.
     * @param view The WebView that initiated the callback.
     * @param newViewingMode  One of the values described in WebView as possible
     *                        values for the viewing mode
     * @hide
     */
    public void onChangeViewingMode(WebView view, int newViewingMode) {}

    /**
     * Tell the host application the current progress of loading a page.
     * @param view The WebView that initiated the callback.