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

Commit 13e9fc19 authored by Tony Huang's avatar Tony Huang
Browse files

Fix split dim when IME shown

ImePositionProcessor didn't handle dim if it didn't not offset
layout, but when landscape, the layout will not offset. It cause
dim value didn't apply.

Fix this by checking both offset and dim value.

Fix: 200757897
Test: manual
Test: pass existing tests
Change-Id: I709b69c8e2d102d0e8237998b26f45c70805bf23
parent 9fbadb5a
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;
        }
    }
}