From 42a6499ee5809c03068f8d2b464f732017ae4549 Mon Sep 17 00:00:00 2001 From: Chilun Huang Date: Fri, 25 Nov 2022 15:22:53 +0800 Subject: [PATCH] Don't insets the divider bar with task bar when IME showing There is no need to insets the divider bar with taskbar when IME showing because there are no rounded corners at the bottom. This also avoids the problem of task bar height not changing when IME floating. Bug: 257011088 Test: Manual check the task bar does draw to bottom when IME floating and restore when IME hidden. Change-Id: Iba5bbf5247e34f0063e67ddcd0a0b3deb8f772fb --- .../src/com/android/wm/shell/common/split/DividerView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java index e8b0f02653945..214b304df07c9 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java @@ -219,7 +219,11 @@ public class DividerView extends FrameLayout implements View.OnTouchListener { insetsState.getSource(InsetsState.ITYPE_EXTRA_NAVIGATION_BAR); // Only insets the divider bar with task bar when it's expanded so that the rounded corners // will be drawn against task bar. - if (taskBarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight) { + // But there is no need to do it when IME showing because there are no rounded corners at + // the bottom. This also avoids the problem of task bar height not changing when IME + // floating. + if (!insetsState.getSourceOrDefaultVisibility(InsetsState.ITYPE_IME) + && taskBarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight) { mTempRect.inset(taskBarInsetsSource.calculateVisibleInsets(mTempRect)); }