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

Commit 026c5e70 authored by Heemin Seog's avatar Heemin Seog Committed by Automerger Merge Worker
Browse files

Merge "Smooth out IME animation for automotive devices" into rvc-qpr-dev am:...

Merge "Smooth out IME animation for automotive devices" into rvc-qpr-dev am: d9892a1f am: bab4e207

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12404434

Change-Id: I1271f81fb84bf404613d26a9bfe747ba9cb1072d
parents 31dbc67d bab4e207
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1210,15 +1210,19 @@ public class InputMethodService extends AbstractInputMethodService {
        mWindow.getWindow().getAttributes().setFitInsetsIgnoringVisibility(true);

        // IME layout should always be inset by navigation bar, no matter its current visibility,
        // unless automotive requests it, since automotive may hide the navigation bar.
        // unless automotive requests it. Automotive devices may request the navigation bar to be
        // hidden when the IME shows up (controlled via config_automotiveHideNavBarForKeyboard)
        // in order to maximize the visible screen real estate. When this happens, the IME window
        // should animate from the bottom of the screen to reduce the jank that happens from the
        // lack of synchronization between the bottom system window and the IME window.
        if (mIsAutomotive && mAutomotiveHideNavBarForKeyboard) {
            mWindow.getWindow().setDecorFitsSystemWindows(false);
        }
        mWindow.getWindow().getDecorView().setOnApplyWindowInsetsListener(
                (v, insets) -> v.onApplyWindowInsets(
                        new WindowInsets.Builder(insets).setInsets(
                                navigationBars(),
                                mIsAutomotive && mAutomotiveHideNavBarForKeyboard
                                        ? android.graphics.Insets.NONE
                                        : insets.getInsetsIgnoringVisibility(navigationBars())
                                )
                                insets.getInsetsIgnoringVisibility(navigationBars()))
                                .build()));

        // For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set