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

Commit 6382ade0 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Invalidate text display list on scroll

This is a problem only when using TextView's internal scroll.
Since there was no bug report about this obvious problem, it
looks like most EditText are single ine or located inside of
a ScrollView.

Change-Id: I699ad0078c9df64c70d10c64f0293b404485e05f
parent f17981b3
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -8276,9 +8276,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    protected void onScrollChanged(int horiz, int vert, int oldHoriz, int oldVert) {
        super.onScrollChanged(horiz, vert, oldHoriz, oldVert);
        if (mEditor != null && getEditor().mPositionListener != null) {
        if (mEditor != null) {
            if (getEditor().mPositionListener != null) {
                getEditor().mPositionListener.onScrollChanged();
            }
            getEditor().mTextDisplayListIsValid = false;
        }
    }

    /**
@@ -10684,9 +10687,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                return;
            }

            if (offset != mPreviousOffset || parentScrolled) {
            boolean offsetChanged = offset != mPreviousOffset;
            if (offsetChanged || parentScrolled) {
                if (offsetChanged) {
                    updateSelection(offset);
                    addPositionToTouchUpFilter(offset);
                }
                final int line = mLayout.getLineForOffset(offset);

                mPositionX = (int) (mLayout.getPrimaryHorizontal(offset) - 0.5f - mHotspotX);