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

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

resolved conflicts for merge of 46ca6a22 to master

Change-Id: I8302fa2f5acf91fb3793e5978a5dc63ac8f3a457
parents 7a1af976 46ca6a22
Loading
Loading
Loading
Loading
+24 −11
Original line number Original line Diff line number Diff line
@@ -317,6 +317,22 @@ import java.util.ArrayList;
        return ptr == mNodePointer;
        return ptr == mNodePointer;
    }
    }


    /**
     * Ensure that the underlying textfield is lined up with the WebTextView.
     */
    private void lineUpScroll() {
        Layout layout = getLayout();
        if (mWebView != null && layout != null) {
            float maxScrollX = Touch.getMaxScrollX(this, layout, mScrollY);
            if (DebugFlags.WEB_TEXT_VIEW) {
                Log.v(LOGTAG, "onTouchEvent x=" + mScrollX + " y="
                        + mScrollY + " maxX=" + maxScrollX);
            }
            mWebView.scrollFocusedTextInput(maxScrollX > 0 ?
                    mScrollX / maxScrollX : 0, mScrollY);
        }
    }

    @Override public InputConnection onCreateInputConnection(
    @Override public InputConnection onCreateInputConnection(
            EditorInfo outAttrs) {
            EditorInfo outAttrs) {
        InputConnection connection = super.onCreateInputConnection(outAttrs);
        InputConnection connection = super.onCreateInputConnection(outAttrs);
@@ -411,6 +427,12 @@ import java.util.ArrayList;
        mFromFocusChange = false;
        mFromFocusChange = false;
    }
    }


    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        lineUpScroll();
    }

    @Override
    @Override
    protected void onSelectionChanged(int selStart, int selEnd) {
    protected void onSelectionChanged(int selStart, int selEnd) {
        if (!mFromWebKit && !mFromFocusChange && !mFromSetInputType
        if (!mFromWebKit && !mFromFocusChange && !mFromSetInputType
@@ -420,6 +442,7 @@ import java.util.ArrayList;
                        + " selEnd=" + selEnd);
                        + " selEnd=" + selEnd);
            }
            }
            mWebView.setSelection(selStart, selEnd);
            mWebView.setSelection(selStart, selEnd);
            lineUpScroll();
        }
        }
    }
    }


@@ -544,17 +567,7 @@ import java.util.ArrayList;
            // to big for the case of a small textfield.
            // to big for the case of a small textfield.
            int smallerSlop = slop/2;
            int smallerSlop = slop/2;
            if (dx > smallerSlop || dy > smallerSlop) {
            if (dx > smallerSlop || dy > smallerSlop) {
                Layout layout = getLayout();
                // Scrolling is handled in onScrollChanged.
                if (mWebView != null && layout != null) {
                    float maxScrollX = (float) Touch.getMaxScrollX(this, layout,
                            mScrollY);
                    if (DebugFlags.WEB_TEXT_VIEW) {
                        Log.v(LOGTAG, "onTouchEvent x=" + mScrollX + " y="
                                + mScrollY + " maxX=" + maxScrollX);
                    }
                    mWebView.scrollFocusedTextInput(maxScrollX > 0 ?
                            mScrollX / maxScrollX : 0, mScrollY);
                }
                mScrolled = true;
                mScrolled = true;
                cancelLongPress();
                cancelLongPress();
                return true;
                return true;