[英]How to hide bottom layout from Swipe-to-reveal RecyclerView menu item when user scrolls?
I am using this class (there is a lot of code, so I won't post it here) to implement Swipe-to-reveal action, and when user swipes from right to left on any CardView item in RecyclerView, bottom layout is shown with some buttons. 我正在使用此类 (有很多代码,因此我不会在此处发布)来实现“滑动到显示”操作,当用户在RecyclerView中的任何CardView项目上从右向左滑动时,将显示底部布局与一些按钮。 When user swipes from left to right, bottom layout is hidden: 当用户从左向右滑动时,底部布局被隐藏:
Everything works great, but I want to achieve effect which allow users to automatically hide bottom layout with extra buttons when they scroll. 一切都很好,但我想实现这样的效果:允许用户在滚动时自动隐藏带有额外按钮的底部布局。 There are methods named open() and close() in the class above, and I am trying to call them in onDown() method: 上面的类中有一些名为open()和close()的方法,我试图在onDown()方法中调用它们:
mDragHelper.smoothSlideViewTo(mMainView, mRectMainClose.left, mRectMainClose.top);
but I'm getting this error: 但我收到此错误:
Found this very awesome library named SwipeRevealLayout from chthai64. 从chthai64找到了一个非常棒的名为SwipeRevealLayout的库 。
Maybe someone will find this useful, I did! 也许有人会发现这个有用,我做到了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.