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

Commit dd64243d authored by Winson's avatar Winson Committed by Winson Chung
Browse files

Fixing stack scroll when dismissing tasks.

- Should be adjusting the offset when pulling forward, not the whole
  stack scroll.  This caused a visual regression where the whole stack 
  shifted when you dismiss the non-first task.

Change-Id: I93158287a168f407a0a024e0be24f264dd0c2b6e
parent 7b3ccf54
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1220,14 +1220,13 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
            } else if (pullStackForward) {
                // Otherwise, offset the scroll by the movement of the anchor task
                float anchorTaskScroll = mLayoutAlgorithm.getStackScrollForTask(anchorTask);
                float newStackScroll = mStackScroller.getStackScroll() +
                        (anchorTaskScroll - prevAnchorTaskScroll);
                float stackScrollOffset = (anchorTaskScroll - prevAnchorTaskScroll);
                if (mLayoutAlgorithm.getFocusState() != TaskStackLayoutAlgorithm.STATE_FOCUSED) {
                    // If we are focused, we don't want the front task to move, but otherwise, we
                    // allow the back task to move up, and the front task to move back
                    newStackScroll /= 2;
                    stackScrollOffset /= 2;
                }
                mStackScroller.setStackScroll(newStackScroll);
                mStackScroller.setStackScroll(mStackScroller.getStackScroll() + stackScrollOffset);
                mStackScroller.boundScroll();
            }