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

Commit 841594b2 authored by Michael Jurka's avatar Michael Jurka
Browse files

Fix jump cut when dismissing items in Recents

(fixing horizontal scroll view in this CL... whoops).

Bug: 7070897
Change-Id: I3a63799ce7f3d9a50869755ee3289e641fa82fa4
parent 30ed33b1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -156,19 +156,19 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
        }
        setLayoutTransition(transitioner);

        // Scroll to end after layout.
        final ViewTreeObserver observer = getViewTreeObserver();
        // Scroll to end after initial layout.

        final OnGlobalLayoutListener updateScroll = new OnGlobalLayoutListener() {
                public void onGlobalLayout() {
                    mLastScrollPosition = scrollPositionOfMostRecent();
                    scrollTo(mLastScrollPosition, 0);
                    final ViewTreeObserver observer = getViewTreeObserver();
                    if (observer.isAlive()) {
                        observer.removeOnGlobalLayoutListener(this);
                    }
                }
            };
        observer.addOnGlobalLayoutListener(updateScroll);
        getViewTreeObserver().addOnGlobalLayoutListener(updateScroll);
    }

    @Override