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
Hi - Figured out the solution from Google's MultiSwipeRefreshLayout code (The rest of the code was along the lines of sample: "ParallaxToolbarScrollViewActivity.java")
@Overridepublic 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);}
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);
}