Fix inline reply notification not aligned to IME
When inline replying within a notification, the notification's bottom should align to the opened IME. This was broken due to multiple problems: 1. When calculating the position of the notification within the stack, there was only a default padding between notifications considered. However, there are cases when a larger gap is added between notifications. (See `StackScrollAlgorithm.childNeedsGapHeight()`) 2. The scrimTopPadding is also not considered in the same calculation. 3. In the split shade mode, it needs to be taken into account that the top of the NotificationStackScrollLayout is not at 0. Therefore this offset needs to be subtracted in the `getImeInset()` function. 4. `mBottomInset` was set to `inset.getInset(WindowInset.Type.ime()).bottom + inset.getSystemWindowInsetBottom()`. The `+ inset.getSystemWindowInsetBottom()` part compensated for the aforementioned three miscalculations in some lucky cases. After fixing the three miscalculations, this is not needed anymore. Bug: 233683829 Test: Manual, i.e. posting multiple notifications (in separate groups) with an inline reply option and ensuring that the bottom of the notification is aligned to the top of the IME. I tested this on split shade and normal shade. Change-Id: Iceaf0ac540ed367cb49eb3aca7bdec7b7cabb1cb
Loading
Please register or sign in to comment