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

Commit 1e16d8b0 authored by Brian Attwell's avatar Brian Attwell Committed by Android Git Automerger
Browse files

am fff7ad26: Fix bugs MultiShrinkScroller#snapToBottom()

* commit 'fff7ad26':
  Fix bugs MultiShrinkScroller#snapToBottom()
parents 64e9305f fff7ad26
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -535,12 +535,24 @@ public class MultiShrinkScroller extends FrameLayout {
        if (mHasEverTouchedTheTop) {
            // If QuickContacts has touched the top of the screen previously, then we
            // will less aggressively snap to the bottom of the screen.
            final float predictedScrollPastTop = -getScroll() + mIntermediateHeaderHeight
            final float predictedScrollPastTop = -getScroll() + mTransparentStartHeight
                    - flingDelta;
            final boolean isLandscape = getResources().getConfiguration().orientation
                    == Configuration.ORIENTATION_LANDSCAPE;
            if (isLandscape) {
                // In landscape orientation, we dismiss the QC once it goes below the starting
                // starting offset that is used when QC starts in collapsed mode.
                if (predictedScrollPastTop > mTransparentStartHeight) {
                    scrollOffBottom();
                }
            } else {
                // In portrait orientation, we dismiss the QC once it goes below
                // mIntermediateHeaderHeight within the bottom of the screen.
                final float heightMinusHeader = getHeight() - mIntermediateHeaderHeight;
                if (predictedScrollPastTop > heightMinusHeader) {
                    scrollOffBottom();
                }
            }
            return;
        }
        if (-getScroll() - flingDelta > 0) {