Ignore events that occur between app icons on the taskbar

Bug: 297325541
Flag: com.android.launcher3.show_taskbar_pinning_popup_from_anywhere
Test: manual, flip the flag, long-click between taskbar items
Change-Id: If2ee00f31fcd1788bac2c2c0cd78ba1eada86115
This commit is contained in:
Artsiom Mitrokhin
2024-10-18 14:33:13 -04:00
parent 8ed2ef9029
commit 7205b24938
7 changed files with 58 additions and 23 deletions
@@ -1306,7 +1306,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// If the task bar is not start aligned, the navigation bar is located in the center
// between the taskbar and screen edges, depending on the bubble bar location.
float navbarWidth = mNavButtonContainer.getWidth();
Rect taskbarBounds = mControllers.taskbarViewController.getIconLayoutBounds();
Rect taskbarBounds = mControllers.taskbarViewController
.getTransientTaskbarIconLayoutBoundsInParent();
if (isNavbarOnRight) {
if (mNavButtonsView.isLayoutRtl()) {
float taskBarEnd = taskbarBounds.right;
@@ -1326,8 +1327,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
public void onLayoutsUpdated() {
// no need to do anything if on phone, or if taskbar or navbar views were not placed on
// screen.
Rect transientTaskbarIconLayoutBoundsInParent = mControllers.taskbarViewController
.getTransientTaskbarIconLayoutBoundsInParent();
if (mContext.getDeviceProfile().isPhone
|| mControllers.taskbarViewController.getIconLayoutBounds().isEmpty()
|| transientTaskbarIconLayoutBoundsInParent.isEmpty()
|| mNavButtonsView.getWidth() == 0) {
return;
}