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

Commit 9a0890c1 authored by Michael Jurka's avatar Michael Jurka
Browse files

Fix jump cut when dismissing items in Recents

Bug: 7070897
parent c56e5600
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -165,19 +165,18 @@ public class RecentsVerticalScrollView extends ScrollView
        }
        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(0, mLastScrollPosition);
                    final ViewTreeObserver observer = getViewTreeObserver();
                    if (observer.isAlive()) {
                        observer.removeOnGlobalLayoutListener(this);
                    }
                }
            };
        observer.addOnGlobalLayoutListener(updateScroll);
        getViewTreeObserver().addOnGlobalLayoutListener(updateScroll);
    }

    @Override