i just want to detect the position of the scroll nestedscrollview android at the bottom, and the to call function. my code is :
scroll.getViewTreeObserver()
for api <23 you can add a treeObserver.scrollChangeLister store a local float variable and check which way your scrolling like this
example
public class About extends AppCompatActivity implements
ViewTreeObserver.OnScrollChangedListener{
private float viewScrolled = 0;
nestedScrollView.getViewTreeObserver().addOnScrollChangedListener(this);
}
@Override
public void onScrollChanged() {
if (viewScrolled < nestedScrollView.getScrollY()){
viewScrolled = nestedScrollView.getScrollY();
Log.d(TAG, "scrolling up");
}
if (viewScrolled > nestedScrollView.getScrollY()){
viewScrolled = nestedScrollView.getScrollY();
Log.d(TAG, "scrolling down");
}
}