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

Commit 5cbc5a9f authored by Robert Snoeberger's avatar Robert Snoeberger Committed by Android (Google) Code Review
Browse files

Merge "Scroll to correct position on action up or cancel"

parents e4f1001a 2b5655e8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -282,10 +282,12 @@ class MediaCarouselScrollHandler(
                scrollXAmount = -1 * relativePos
            }
            if (scrollXAmount != 0) {
                val dx = if (isRtl) -scrollXAmount else scrollXAmount
                val newScrollX = scrollView.relativeScrollX + dx
                // Delay the scrolling since scrollView calls springback which cancels
                // the animation again..
                mainExecutor.execute {
                    scrollView.smoothScrollBy(if (isRtl) -scrollXAmount else scrollXAmount, 0)
                    scrollView.smoothScrollTo(newScrollX, scrollView.scrollY)
                }
            }
            val currentTranslation = scrollView.getContentTranslation()