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

Commit ff705eab authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix some taskbar stashing issues" into sc-v2-dev

parents ff2171d2 42b0395f
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -243,7 +243,19 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        if (!mTouchEnabled) {
            return true;
        }
        mControllerCallbacks.onTouchEvent(event);
        if (mIconLayoutBounds.contains((int) event.getX(), (int) event.getY())) {
            // Don't allow long pressing between icons.
            return true;
        }
        if (mControllerCallbacks.onTouchEvent(event)) {
            int oldAction = event.getAction();
            try {
                event.setAction(MotionEvent.ACTION_CANCEL);
                return super.onTouchEvent(event);
            } finally {
                event.setAction(oldAction);
            }
        }
        return super.onTouchEvent(event);
    }

+7 −1
Original line number Diff line number Diff line
@@ -223,7 +223,11 @@ public class TaskbarViewController {
            return view -> mControllers.taskbarStashController.updateAndAnimateIsStashedInApp(true);
        }

        public void onTouchEvent(MotionEvent motionEvent) {
        /**
         * Get the first chance to handle TaskbarView#onTouchEvent, and return whether we want to
         * consume the touch so TaskbarView treats it as an ACTION_CANCEL.
         */
        public boolean onTouchEvent(MotionEvent motionEvent) {
            final float x = motionEvent.getRawX();
            final float y = motionEvent.getRawY();
            switch (motionEvent.getAction()) {
@@ -239,6 +243,7 @@ public class TaskbarViewController {
                        mControllers.taskbarStashController.startStashHint(
                                /* animateForward= */ false);
                        mCanceledStashHint = true;
                        return true;
                    }
                    break;
                case MotionEvent.ACTION_UP:
@@ -249,6 +254,7 @@ public class TaskbarViewController {
                    }
                    break;
            }
            return false;
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -409,6 +409,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
     * Returns true if the touch down at the provided position be ignored
     */
    protected boolean shouldIgnoreTouchDown(float x, float y) {
        if (mDisplay == DISPLAY_TASKBAR) {
            // Allow touching within padding on taskbar, given icon sizes are smaller.
            return false;
        }
        return y < getPaddingTop()
                || x < getPaddingLeft()
                || y > getHeight() - getPaddingBottom()