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

Commit c26dc9f3 authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Provide variable for debugging the text in WebTextView.

Change-Id: I40630e3ab754c9e9805dc674c8c0c6c8688973c3
parent c35f4ac3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -45,5 +45,9 @@ class DebugFlags {
    public static final boolean WEB_TEXT_VIEW = false;
    public static final boolean WEB_VIEW = false;
    public static final boolean WEB_VIEW_CORE = false;

    /*
     * Set to true to allow the WebTextView to draw on top of the web page in a
     * different color so that you can see how the two line up.
     */
    public static final boolean DRAW_WEBTEXTVIEW = false;
}
+7 −4
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ import junit.framework.Assert;
        // Set the text color to black, regardless of the theme.  This ensures
        // that other applications that use embedded WebViews will properly
        // display the text in password textfields.
        setTextColor(Color.BLACK);
        setTextColor(DebugFlags.DRAW_WEBTEXTVIEW ? Color.RED : Color.BLACK);
        // This helps to align the text better with the text in the web page.
        setIncludeFontPadding(false);
    }
@@ -404,8 +404,9 @@ import junit.framework.Assert;
        // onDraw should only be called for password fields.  If WebTextView is
        // still drawing, but is no longer corresponding to a password field,
        // remove it.
        if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword()
                || !isSameTextField(mWebView.nativeFocusCandidatePointer())) {
        if (!DebugFlags.DRAW_WEBTEXTVIEW && (mWebView == null
                || !mWebView.nativeFocusCandidateIsPassword()
                || !isSameTextField(mWebView.nativeFocusCandidatePointer()))) {
            // Although calling remove() would seem to make more sense here,
            // changing it to not be a password field will make it not draw.
            // Other code will make sure that it is removed completely, but this
@@ -819,7 +820,9 @@ import junit.framework.Assert;
        }
        // For password fields, draw the WebTextView.  For others, just show
        // webkit's drawing.
        if (!DebugFlags.DRAW_WEBTEXTVIEW) {
            setWillNotDraw(!inPassword);
        }
        setBackgroundDrawable(inPassword ? mBackground : null);
    }