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

Commit d733e94f authored by Mihai Popa's avatar Mihai Popa Committed by Android (Google) Code Review
Browse files

Merge "Fix crash after smart selection animation"

parents 59964809 cce6e82d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -282,7 +282,12 @@ public final class SelectionActionModeHelper {
            @Nullable SelectionResult result) {
        final Layout layout = mTextView.getLayout();

        final Runnable onAnimationEndCallback = () -> startSelectionActionMode(result);
        final String originalText = getText(mTextView).toString();
        final Runnable onAnimationEndCallback = () -> {
            if (TextUtils.equals(getText(mTextView), originalText)) {
                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