Simplify/correct Taskbar insetsRoundedCornerFrame calculation

Now we base it on the current tappableElement insets, which will only be
> 0 for the unstashed, persistent taskbar which draws rounded corners.
This inset also stays stable during temporary stash transitions such as
when the IME is showing.

Flag: ENABLE_TRANSIENT_TASKBAR=true, ENABLE_TASKBAR_PINNING=true
Test: in split screen for both transient and pinned (persistent)
taskbar, ensure split screen divider bottom is drawn appropriately
Fixes: 278028503

Change-Id: Iab56c5dc8f9fc81c34aa01f41b5212dd5c6fd7f0
This commit is contained in:
Tony Wickham
2023-04-28 23:35:24 +00:00
parent 396002dcee
commit 3cfada0a00
3 changed files with 20 additions and 43 deletions

View File

@@ -107,9 +107,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
| FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_TASKBAR_ALL_APPS
| FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IN_APP_AUTO;
private static final int FLAGS_STASHED_IN_APP_IGNORING_IME =
FLAGS_STASHED_IN_APP & ~FLAG_STASHED_IN_APP_IME;
// If any of these flags are enabled, inset apps by our stashed height instead of our unstashed
// height. This way the reported insets are consistent even during transitions out of the app.
// Currently any flag that causes us to stash in an app is included, except for IME or All Apps
@@ -414,13 +411,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
return hasAnyFlag(FLAGS_STASHED_IN_APP);
}
/**
* Returns whether the taskbar should be stashed in apps regardless of the IME visibility.
*/
public boolean isStashedInAppIgnoringIme() {
return hasAnyFlag(FLAGS_STASHED_IN_APP_IGNORING_IME);
}
/**
* Returns whether the taskbar should be stashed in the current LauncherState.
*/
@@ -1064,11 +1054,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
private void notifyStashChange(boolean visible, boolean stashed) {
mSystemUiProxy.notifyTaskbarStatus(visible, stashed);
setUpTaskbarSystemAction(visible);
// If stashing taskbar is caused by IME visibility, we could just skip updating rounded
// corner insets since the rounded corners will be covered by IME during IME is showing and
// taskbar will be restored back to unstashed when IME is hidden.
mControllers.taskbarActivityContext.updateInsetRoundedCornerFrame(
visible && !isStashedInAppIgnoringIme());
mControllers.rotationButtonController.onTaskbarStateChange(visible, stashed);
}