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

Commit 3fa9bdb1 authored by Mihai Popa's avatar Mihai Popa Committed by android-build-merger
Browse files

Merge "Fix crash after smart selection animation" into pi-dev

am: 6df95fa0

Change-Id: Ie37f7c1809c71c6ffa44bc20090493d90b4a8c41
parents ce72108f 6df95fa0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -284,7 +284,12 @@ public final class SelectionActionModeHelper {
            @Nullable SelectionResult result) {
        final Layout layout = mTextView.getLayout();

        final Runnable onAnimationEndCallback = () -> startSelectionActionMode(result);
        final Runnable onAnimationEndCallback = () -> {
            if (result.mStart >= 0 && result.mEnd <= getText(mTextView).length()
                    && result.mStart <= result.mEnd) {
                startSelectionActionMode(result);
            }
        };
        // TODO do not trigger the animation if the change included only non-printable characters
        final boolean didSelectionChange =
                result != null && (mTextView.getSelectionStart() != result.mStart