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

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

At the end of a zoom, only check if the textfield is onscreen.

Previously, we checked to see if the IME was active on the WebTextView,
in an attempt to fix http://b/issue?id=2266066 .  If so, we move the
textfield on screen. However, that is resulting in
http://b/issue?id=2147168 , where a textfield far offscreen is being
scrolled on screen at the end of a zoom, and with this change, the
latter bug is fixed.  Further, I am no longer able to reproduce the
earlier bug with this change.
parent d6516294
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -3088,14 +3088,11 @@ public class WebView extends AbsoluteLayout
        Rect vBox = contentToViewRect(contentBounds);
        Rect visibleRect = new Rect();
        calcOurVisibleRect(visibleRect);
        // The IME may have shown, resulting in the textfield being offscreen.
        // If so, the textfield will be scrolled on screen, so treat it as
        // though it is on screen.  If it is on screen, place the WebTextView in
        // its new place, accounting for our new scroll/zoom values.
        InputMethodManager imm = InputMethodManager.peekInstance();
        if ((imm != null && imm.isActive(mWebTextView))
                || (allowIntersect ? Rect.intersects(visibleRect, vBox)
                : visibleRect.contains(vBox))) {
        // If the textfield is on screen, place the WebTextView in
        // its new place, accounting for our new scroll/zoom values,
        // and adjust its textsize.
        if (allowIntersect ? Rect.intersects(visibleRect, vBox)
                : visibleRect.contains(vBox)) {
            mWebTextView.setRect(vBox.left, vBox.top, vBox.width(),
                    vBox.height());
            mWebTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX,