Fix bug where Taskbar was not auto-hiding after splitscreen launch from icon menu

This patch fixes a bug where the transient Taskbar was not hiding properly after splitscreen was initiated. When the user is inside an app and launches splitscreen by longpressing on a Taskbar icon and selecting the split button, the transient Taskbar should hide right away. This is an equivalent action to dragging the Taskbar icon up to create a split, and should hide the Taskbar so that other UI elements (like system-level toasts and error messages) can be seen.

The bug occurred because updateAndAnimateTransientTaskbar() is not being called in this specific code path to stash the Taskbar.

Fixed by adding a new call to updateAndAnimateTransientTaskbar upon clicking the splitscreen menu button.

Fixes: 272292897
Test: Manual
Change-Id: I64a9acfc41ddcaba4d9f43eb216458de44b4c9a4
This commit is contained in:
Jeremy Sim
2023-03-14 12:55:34 -07:00
parent 887c0ae68b
commit 8eed87ac89
6 changed files with 37 additions and 20 deletions

View File

@@ -56,7 +56,6 @@ import android.view.Gravity;
import android.view.RoundedCorner;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.widget.FrameLayout;
import android.widget.Toast;
@@ -80,6 +79,7 @@ import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.AutohideSuspendFlag;
import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback;
@@ -525,6 +525,16 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
setTaskbarWindowFocusable(isVisible);
}
@Override
public void onSplitScreenMenuButtonClicked() {
PopupContainerWithArrow popup = PopupContainerWithArrow.getOpen(this);
if (popup != null) {
popup.addOnCloseCallback(() -> {
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true);
});
}
}
/**
* Sets a new data-source for this taskbar instance
*/