Created
July 25, 2020 08:43
-
-
Save MrCrambo/e176d580d796e89aab35cf52b1518673 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int currentTop = child.getTop(); | |
int newTop = currentTop - dy; | |
if (dy > 0) { | |
if (!ViewCompat.canScrollVertically(target, 1)) { | |
if (newTop >= mMinOffset || mHideable) { | |
consumed[1] = dy; | |
ViewCompat.offsetTopAndBottom(child, -dy); | |
setStateInternal(STATE_DRAGGING); | |
} else { | |
consumed[1] = currentTop - mMinOffset; | |
ViewCompat.offsetTopAndBottom(child, -consumed[1]); | |
setStateInternal(STATE_COLLAPSED); | |
} | |
} | |
} else if (dy < 0) { | |
if (newTop < mMaxOffset) { | |
consumed[1] = dy; | |
ViewCompat.offsetTopAndBottom(child, -dy); | |
setStateInternal(STATE_DRAGGING); | |
} else { | |
consumed[1] = currentTop - mMaxOffset; | |
ViewCompat.offsetTopAndBottom(child, -consumed[1]); | |
setStateInternal(STATE_EXPANDED); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment