Created
April 4, 2020 08:37
-
-
Save XjojoX1989/ab671d1a052ad09c9704cb0975a50407 to your computer and use it in GitHub Desktop.
This file contains 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
public void scrollTo(int x,int y) { | |
if (mScrollX != x || mScrollY != y) { | |
int oldX = mScrollX; | |
int oldY = mScrollY; | |
mScrollX = x; | |
mScrollY = y; | |
invalidateParentCaches(); | |
onScrollChanged(mScrollX,mScrollY,oldX,oldY); | |
if (!awakenScrollBars()) { | |
postInvalidateOnAnimation(); | |
} | |
} | |
} | |
public void scrollBy(int x,int y) { | |
scrollTo(mScrollX + x,mScrollY + y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment