ksoichiro / Android-ObservableScrollView

Android library to observe scroll events on scrollable views.
http://ksoichiro.github.io/Android-ObservableScrollView/
Apache License 2.0
9.66k stars 2.06k forks source link

is:issue is:open How to set up an ObservableScrollView with SwipeRefreshLayout ? Tried out the samples but things don't seem to work. Can someone help ? #241

Closed Sheshlok closed 8 years ago

Sheshlok commented 8 years ago

Hi - Figured out the solution from Google's MultiSwipeRefreshLayout code (The rest of the code was along the lines of sample: "ParallaxToolbarScrollViewActivity.java")

@Override public void onUpOrCancelMotionEvent(ScrollState scrollState) { // If Observable scrollview is not null, is shown, and cannot scroll upwards, then // activate the SwipeRefreshLayout, else de-activate it. if (mObservableScrollView != null && mObservableScrollView.isShown() && !ViewCompat.canScrollVertically(mObservableScrollView, -1)) { mSwipeRefreshLayout.setEnabled(true); } else { mSwipeRefreshLayout.setEnabled(false); }