CardStackView
CardStackView copied to clipboard
Unable to implement Swipe Refresh Layout in CardStackView.
Hi, You have done very great job. I want to implement SwipeRefreshLayout in CardStackView, on Scrolling the cards the SwipeRefreshlayout refreshing the View. If it is recyclerview or WebView we can handle this case, but in CardStackView how can we do this?
I can try that with the nest scroll
Hi, I have tried to implement the functionality in StackScrollDelegateImpl for the UpDownStackAnimation class.
@Override
public void scrollViewTo(int x, int y) {
x = clamp(x, mCardStackView.getWidth() - mCardStackView.getPaddingRight() - mCardStackView.getPaddingLeft(), mCardStackView.getWidth());
y = clamp(y, mCardStackView.getShowHeight(), mCardStackView.getTotalLength());
mScrollY = y;
mScrollX = x;
updateChildPos();
//It will work like SwipeRefreshLayout in RecyclerView.
mCardStackView.getSwipeRefreshLayout().setEnabled(xScrollY==0);
}