Only force layout legacy apps with SOFT_INPUT_ADJUST_RESIZE

Forcing layout for other soft input modes seems redundant while IME
shows or hides, because the layout doesn't change.

It doesn't useful for the system bar cases as well, because the main
content of the fullscreen apps is usually stable.

Fix: 161781474
Test: Open IME in Telegram
Change-Id: Ic64dd86e5804c4b25fa118297eaca3c63c5e0a7d
This commit is contained in:
Tiger Huang
2021-02-08 17:38:28 +08:00
parent ceec07f033
commit 39d15f92ac

View File

@@ -1675,7 +1675,8 @@ public final class ViewRootImpl implements ViewParent,
requestLayout();
// See comment for View.sForceLayoutWhenInsetsChanged
if (View.sForceLayoutWhenInsetsChanged && mView != null) {
if (View.sForceLayoutWhenInsetsChanged && mView != null
&& mWindowAttributes.softInputMode == SOFT_INPUT_ADJUST_RESIZE) {
forceLayout(mView);
}