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

Commit 0b53332c authored by Brian Isganitis's avatar Brian Isganitis Committed by Android (Google) Code Review
Browse files

Merge changes I35fe528b,Ia612c1b5 into udc-dev

* changes:
  Don't close AFVs when opening Taskbar folder.
  Keep persistent Taskbar visible over Taskbar All Apps.
parents 3a75b494 f3135fea
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());
    }

    /**
+10 −2
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);
        }
@@ -773,6 +777,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    }

    protected void onTaskbarIconClicked(View view) {
        boolean shouldCloseAllOpenViews = true;
        Object tag = view.getTag();
        if (tag instanceof Task) {
            Task task = (Task) tag;
@@ -780,6 +785,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                    ActivityOptions.makeBasic());
            mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(true);
        } else if (tag instanceof FolderInfo) {
            shouldCloseAllOpenViews = false;
            FolderIcon folderIcon = (FolderIcon) view;
            Folder folder = folderIcon.getFolder();

@@ -876,8 +882,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
            Log.e(TAG, "Unknown type clicked: " + tag);
        }

        if (shouldCloseAllOpenViews) {
            AbstractFloatingView.closeAllOpenViews(this);
        }
    }

    /**
     * Run when the user taps a Taskbar icon while in Overview. If the tapped app is currently
+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
@@ -933,20 +933,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