Last active
December 24, 2015 21:39
-
-
Save semihozkoroglu/6867533 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
@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