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

Commit 855396d3 authored by Petar Šegina's avatar Petar Šegina
Browse files

Don't run Smart Select Animation on multiple lines

This behavior is currently broken due to the format of the rectangles
returned by Layout::getSelection. Let's disable the animation in
multiline scenarios until this behavior is fixed.

Test: manual - enable Smart Select flag and test over single and
multiple lines
Change-Id: Id0c49a0d69a8f2bdb449cfc8f0ed43e529f41cc1
parent b1671e0e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -200,6 +200,17 @@ final class SelectionActionModeHelper {
        final List<RectF> selectionRectangles =
                convertSelectionToRectangles(layout, result.mStart, result.mEnd);

        /*
         * Do not run the Smart Select animation when there are multiple lines involved, as this
         * behavior is currently broken.
         *
         * TODO fix Smart Select Animation when the selection spans multiple lines
         */
        if (selectionRectangles.size() != 1) {
            onAnimationEndCallback.run();
            return;
        }

        /*
         * TODO Figure out a more robust approach for this
         * We have to translate all the generated rectangles by the top-left padding of the