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

Skip to content
Commit 04618610 authored by Jeremy Sim's avatar Jeremy Sim
Browse files

Fix unnecessary slide-up movement for IME in flex split

When IME is triggered in splitscreen, there is existing logic that translates the app surface up if the focused app is on the bottom of the screen. This helps the app content not be obscured by the IME. We also still want to keep the top app somewhat visible, so we cap the translation at the point where 30% of the top app is left visible.

However, the existing calculation assumes that apps are fully onscreen, which is no longer true in the era of flexible split.

This CL updates the calculation in `getTargetYOffset()` so that it works for offscreen apps as well as onscreen-only apps.

The calculation logic was like this before:
1) we want to translate up the bottom app by x amount (desireOffset)
2) but theres a max we want to translate it by (0.7f of the size of the top app) (maxOffset)
3) so try to translate up by desireOffset, but stop at maxOffset

Now it's like this:
1) we want to translate up the bottom app by x amount (desireOffset)
2) but theres a max we want to translate it by (*we still need 0.3f of the top app to be visible*) (maxOffset)
3) so try to translate up by desireOffset, but stop at maxOffset

When the top app is fully onscreen, they are equivalent statements, but in flex split, the latter calculation returns the correct value.

Fixes: 399727927
Flag: com.android.wm.shell.enable_flexible_two_app_split
Test: Looks good when in 10:90 and activating IME.
Change-Id: I082804c6ead48a2cc7ba193e3585310d0bcca005
parent fc2d0835
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment