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

Commit 9c311b29 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Keep persistent Taskbar visible over Taskbar All Apps.

Additionally, this CL fixes some touchable insets issues with the
overlay window. Dragging and dropping is now reliable from taskbar while
All Apps or EDU is also open.

Change-Id: Ia612c1b5266a8fb2b7005a773fbd2b00ec4824db
Bug: 279465803
Bug: 275890048
Bug: 264463659
Flag: PERSISTENT_TASKBAR_OVER_TASKBAR_ALL_APPS (Teamfood)
Test: Taskbar is functional over All Apps and EDU.
parent 46b73c23
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -47,9 +47,7 @@ public class DesktopNavbarButtonsViewController extends NavbarButtonsViewControl
        mStartContextualContainer = mNavButtonsView.findViewById(R.id.start_contextual_buttons);
        mAllAppsButton = LayoutInflater.from(context)
                .inflate(R.layout.taskbar_all_apps_button, mStartContextualContainer, false);
        mAllAppsButton.setOnClickListener((View v) -> {
            mControllers.taskbarAllAppsController.show();
        });
        mAllAppsButton.setOnClickListener(v -> mControllers.taskbarAllAppsController.toggle());
    }

    /**
+5 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;

import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY;
import static com.android.launcher3.Utilities.isRunningInTestHarness;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
@@ -661,7 +662,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    void onDragEndOrViewRemoved() {
        boolean isDragInProgress = mControllers.taskbarDragController.isSystemDragInProgress();

        if (!isDragInProgress && !AbstractFloatingView.hasOpenView(this, TYPE_ALL)) {
        // Overlay AFVs are in a separate window and do not require Taskbar to be fullscreen.
        if (!isDragInProgress
                && !AbstractFloatingView.hasOpenView(
                        this, TYPE_ALL & ~TYPE_TASKBAR_OVERLAY_PROXY)) {
            // Reverts Taskbar window to its original size
            setTaskbarWindowFullscreen(false);
        }
+4 −4
Original line number Diff line number Diff line
@@ -308,15 +308,12 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
        // Pre-drag has ended, start the global system drag.
        if (mDisallowGlobalDrag) {
            AbstractFloatingView.closeAllOpenViewsExcept(mActivity, TYPE_TASKBAR_ALL_APPS);
        } else {
            AbstractFloatingView.closeAllOpenViews(mActivity);
            return;
        }

        startSystemDrag((BubbleTextView) mDragObject.originalView);
    }

    private void startSystemDrag(BubbleTextView btv) {
        if (mDisallowGlobalDrag) return;
        View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(btv) {

            @Override
@@ -412,6 +409,9 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
                        .log(StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DRAG_STARTED);
            }
        }

        // Wait to close until after system drag has started, if applicable.
        AbstractFloatingView.closeAllOpenViews(mActivity);
    }

    private void onSystemDragStarted(BubbleTextView btv) {
+9 −21
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ import android.view.WindowManager
import android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD
import android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION
import com.android.internal.policy.GestureNavigationSettingsObserver
import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY
import com.android.launcher3.DeviceProfile
import com.android.launcher3.R
import com.android.launcher3.anim.AlphaUpdateListener
@@ -190,7 +188,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
    /**
     * Called to update the touchable insets.
     *
     * @see InternalInsetsInfo.setTouchableInsets
     * @see ViewTreeObserver.InternalInsetsInfo.setTouchableInsets
     */
    fun updateInsetsTouchability(insetsInfo: ViewTreeObserver.InternalInsetsInfo) {
        insetsInfo.touchableRegion.setEmpty()
@@ -205,7 +203,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
        } else if (
            controllers.navbarButtonsViewController.isImeVisible &&
                controllers.taskbarStashController.isStashed()
                controllers.taskbarStashController.isStashed
        ) {
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
        } else if (!controllers.uiController.isTaskbarTouchable) {
@@ -214,26 +212,16 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
        } else if (controllers.taskbarDragController.isSystemDragInProgress) {
            // Let touches pass through us.
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
        } else if (AbstractFloatingView.hasOpenView(context, TYPE_TASKBAR_OVERLAY_PROXY)) {
            // Let touches pass through us if icons are hidden.
            if (controllers.taskbarViewController.areIconsVisible()) {
                insetsInfo.touchableRegion.set(touchableRegion)
            }
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
        } else if (context.isTaskbarWindowFullscreen) {
            // Intercept entire fullscreen window.
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_FRAME)
            insetsIsTouchableRegion = false
        } else if (
            controllers.taskbarViewController.areIconsVisible() ||
                AbstractFloatingView.hasOpenView(context, AbstractFloatingView.TYPE_ALL) ||
                context.isNavBarKidsModeActive
            controllers.taskbarViewController.areIconsVisible() || context.isNavBarKidsModeActive
        ) {
            // Taskbar has some touchable elements, take over the full taskbar area
            insetsInfo.setTouchableInsets(
                if (context.isTaskbarWindowFullscreen) {
                    TOUCHABLE_INSETS_FRAME
                } else {
            insetsInfo.touchableRegion.set(touchableRegion)
                    TOUCHABLE_INSETS_REGION
                }
            )
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
            insetsIsTouchableRegion = false
        } else {
            insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION)
+0 −14
Original line number Diff line number Diff line
@@ -930,20 +930,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
        }
    }

    /**
     * Resets the flag if no system gesture is in progress.
     * <p>
     * Otherwise, the reset should be deferred until after the gesture is finished.
     *
     * @see #setSystemGestureInProgress
     */
    public void resetFlagIfNoGestureInProgress(int flag) {
        if (!mIsSystemGestureInProgress) {
            updateStateForFlag(flag, false);
            applyState(mControllers.taskbarOverlayController.getCloseDuration());
        }
    }

    /**
     * When hiding the IME, delay the unstash animation to align with the end of the transition.
     */
Loading