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

Commit 6bb4d07b authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "Fix split dim when IME shown" into sc-v2-dev

parents abdb320b 13e9fc19
Loading
Loading
Loading
Loading
+21 −16
Original line number Diff line number Diff line
@@ -776,8 +776,9 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
        boolean adjustSurfaceLayoutForIme(SurfaceControl.Transaction t,
                SurfaceControl dividerLeash, SurfaceControl leash1, SurfaceControl leash2,
                SurfaceControl dimLayer1, SurfaceControl dimLayer2) {
            if (mYOffsetForIme == 0) return false;

            final boolean showDim = mDimValue1 > 0.001f || mDimValue2 > 0.001f;
            boolean adjusted = false;
            if (mYOffsetForIme != 0) {
                if (dividerLeash != null) {
                    mTempRect.set(mDividerBounds);
                    mTempRect.offset(0, mYOffsetForIme);
@@ -791,11 +792,15 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
                mTempRect.set(mBounds2);
                mTempRect.offset(0, mYOffsetForIme);
                t.setPosition(leash2, mTempRect.left, mTempRect.top);
                adjusted = true;
            }

            if (showDim) {
                t.setAlpha(dimLayer1, mDimValue1).setVisibility(dimLayer1, mDimValue1 > 0.001f);
                t.setAlpha(dimLayer2, mDimValue2).setVisibility(dimLayer2, mDimValue2 > 0.001f);

            return true;
                adjusted = true;
            }
            return adjusted;
        }
    }
}