Disable pinning popup when transient taskbar is disabled

On freeform displays where taskbar is always pinned, toggling "Always
show taskbar" option is no-op, as the taskbar won't transition to
transient taskbar.
Left a TODO to reevaluate behavior once desktop taskbar transient
behavior gets updated.

Bug: 390665752
Flag: com.android.window.flags.enable_desktop_taskbar_on_freeform_displays
Test: Manual.

Change-Id: Icfe7cd26e77de48ab34bfe4932bfedfe21923ef1
This commit is contained in:
Toni Barzic
2025-04-10 05:04:22 +00:00
parent 8ec6581db0
commit e5fc903495
5 changed files with 32 additions and 12 deletions
@@ -350,26 +350,32 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
mIconLongClickListener = mControllerCallbacks.getIconOnLongClickListener();
mAllAppsButtonContainer.setUpCallbacks(callbacks);
if (mTaskbarDividerContainer != null
&& mActivityContext.getTaskbarFeatureEvaluator().getSupportsPinningPopup()) {
mTaskbarDividerContainer.setUpCallbacks(callbacks);
}
if (mTaskbarOverflowView != null) {
mTaskbarOverflowView.setOnClickListener(
mControllerCallbacks.getOverflowOnClickListener());
mTaskbarOverflowView.setOnLongClickListener(
mControllerCallbacks.getOverflowOnLongClickListener());
}
if (Flags.showTaskbarPinningPopupFromAnywhere()
&& mActivityContext.getTaskbarFeatureEvaluator().getSupportsPinningPopup()) {
setOnTouchListener(mControllerCallbacks.getTaskbarTouchListener());
}
if (Flags.taskbarOverflow()) {
mMaxNumIcons = calculateMaxNumIcons();
}
}
void updatePinningPopupEventHandlers() {
boolean supportsPinningPopup =
mActivityContext.getTaskbarFeatureEvaluator().getSupportsPinningPopup();
if (mTaskbarDividerContainer != null) {
mTaskbarDividerContainer.setUpCallbacks(
supportsPinningPopup ? mControllerCallbacks : null);
}
if (Flags.showTaskbarPinningPopupFromAnywhere()) {
setOnTouchListener(
supportsPinningPopup ? mControllerCallbacks.getTaskbarTouchListener() : null);
}
}
private void removeAndRecycle(View view) {
removeView(view);
view.setOnClickListener(null);