CardStackView icon indicating copy to clipboard operation
CardStackView copied to clipboard

Unable to implement Swipe Refresh Layout in CardStackView.

Open kashyapasrc opened this issue 6 years ago • 2 comments

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?

kashyapasrc avatar Mar 06 '18 04:03 kashyapasrc

I can try that with the nest scroll

ToDou avatar Mar 13 '18 08:03 ToDou

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);
    

}

kashyapasrc avatar Apr 07 '18 19:04 kashyapasrc