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

Commit ddc421d1 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Update edit text size when the text changes so scroll works."

parents 8d3c318b c6c549d8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1254,6 +1254,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
    static final int FOCUS_NODE_CHANGED                 = 147;
    static final int AUTOFILL_FORM                      = 148;
    static final int ANIMATE_TEXT_SCROLL                = 149;
    static final int EDIT_TEXT_SIZE_CHANGED             = 150;

    private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID;
    private static final int LAST_PACKAGE_MSG_ID = HIT_TEST_RESULT;
@@ -8504,6 +8505,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                    computeEditTextScroll();
                    break;

                case EDIT_TEXT_SIZE_CHANGED:
                    if (msg.arg1 == mFieldPointer) {
                        mEditTextContent.set((Rect)msg.obj);
                    }
                    break;

                default:
                    super.handleMessage(msg);
                    break;
+12 −0
Original line number Diff line number Diff line
@@ -2778,6 +2778,18 @@ public final class WebViewCore {
        }
    }

    // called by JNI
    private void updateTextSizeAndScroll(int pointer, int width, int height,
            int scrollX, int scrollY) {
        if (mWebView != null) {
            Rect rect = new Rect(-scrollX, -scrollY, width - scrollX,
                    height - scrollY);
            Message.obtain(mWebView.mPrivateHandler,
                    WebViewClassic.EDIT_TEXT_SIZE_CHANGED, pointer, 0, rect)
                    .sendToTarget();
        }
    }

    // called by JNI
    private void clearTextEntry() {
        if (mWebView == null) return;