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

Commit c98a786c authored by Raph Levien's avatar Raph Levien Committed by Android Git Automerger
Browse files

am beabcb92: Merge "Fix Insertion ActionMode not showing on RTL languages" into mnc-dev

* commit 'beabcb92':
  Fix Insertion ActionMode not showing on RTL languages
parents 5679800f beabcb92
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3308,7 +3308,7 @@ public class Editor {
                mSelectionBounds.set(
                        primaryHorizontal,
                        layout.getLineTop(line),
                        primaryHorizontal + 1,
                        primaryHorizontal,
                        layout.getLineTop(line + 1) + mHandleHeight);
            }
            // Take TextView's padding and scroll into account.
+10 −2
Original line number Diff line number Diff line
@@ -194,8 +194,16 @@ public class FloatingActionMode extends ActionMode {
            mContext.getResources().getDisplayMetrics().widthPixels,
            mContext.getResources().getDisplayMetrics().heightPixels);

        return Rect.intersects(mContentRectOnScreen, mScreenRect)
            && Rect.intersects(mContentRectOnScreen, mViewRectOnScreen);
        return intersectsClosed(mContentRectOnScreen, mScreenRect)
            && intersectsClosed(mContentRectOnScreen, mViewRectOnScreen);
    }

    /*
     * Same as Rect.intersects, but includes cases where the rectangles touch.
    */
    private static boolean intersectsClosed(Rect a, Rect b) {
         return a.left <= b.right && b.left <= a.right
                 && a.top <= b.bottom && b.top <= a.bottom;
    }

    @Override