Skip to content

Instantly share code, notes, and snippets.

@semihozkoroglu
Last active December 24, 2015 21:39
Show Gist options
  • Save semihozkoroglu/6867533 to your computer and use it in GitHub Desktop.
Save semihozkoroglu/6867533 to your computer and use it in GitHub Desktop.
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
if(scrollListener != null) {
View view = (View) getChildAt(getChildCount()-1);
int diff = (view.getBottom()-(getHeight()+getScrollY()));
if(diff == 0) {
if (!scrollLock) {
setScrollLock(true);
scrollListener.onScrollChanged(l, t, oldl, oldt, diff);
}
} else {
setScrollLock(false);
}
}
super.onScrollChanged(l, t, oldl, oldt);
}
public void setScrollLock(boolean lock) {
scrollLock = lock;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment