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

Commit 4603bd34 authored by Abodunrinwa Toki's avatar Abodunrinwa Toki Committed by Android (Google) Code Review
Browse files

Merge "FloatingToolbar: Offset visible rect by the rootview's offset" into mnc-dev

parents 2047929e 5e231003
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public class FloatingActionMode extends ActionMode {
    private final Rect mPreviousContentRectOnWindow;
    private final int[] mViewPosition;
    private final int[] mPreviousViewPosition;
    private final int[] mRootViewPosition;
    private final Rect mViewRect;
    private final Rect mPreviousViewRect;
    private final Rect mScreenRect;
@@ -80,6 +81,7 @@ public class FloatingActionMode extends ActionMode {
        mPreviousContentRectOnWindow = new Rect();
        mViewPosition = new int[2];
        mPreviousViewPosition = new int[2];
        mRootViewPosition = new int[2];
        mViewRect = new Rect();
        mPreviousViewRect = new Rect();
        mScreenRect = new Rect();
@@ -137,7 +139,9 @@ public class FloatingActionMode extends ActionMode {
        checkToolbarInitialized();

        mOriginatingView.getLocationInWindow(mViewPosition);
        mOriginatingView.getRootView().getLocationInWindow(mRootViewPosition);
        mOriginatingView.getGlobalVisibleRect(mViewRect);
        mViewRect.offset(mRootViewPosition[0], mRootViewPosition[1]);

        if (!Arrays.equals(mViewPosition, mPreviousViewPosition)
                || !mViewRect.equals(mPreviousViewRect)) {