简体   繁体   English

带有手势动作的RecyclerView

[英]RecyclerView with swipe gesture actions

I'm a new Android developer and I would like to use swipe actions on a RecyclerView Items like the video below I found on material.io (please see link below) 我是一名新的Android开发人员,我想在RecyclerView项目上使用滑动操作,例如我在material.io上找到的以下视频(请参见下面的链接)

I found a lot of libraries but often swipe gesture is for remove items or reveal buttons. 我发现了很多资料库,但经常滑动手势是为了删除项目或显示按钮。 It's not what I want. 这不是我想要的。 Could you please help me to create the same behaviour as shown in this below example ("elastic" effect, swipe left or right, background color animation with icon update) ? 您能否帮我创建以下示例中所示的行为(“弹性”效果,向左或向右滑动,带有图标更新的背景色动画)?

Maybe a library already exists?? 也许图书馆已经存在了?

Thanks for your help 谢谢你的帮助

https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1gSz-L39Or4aM8GhQn0ZhnUkaV5E-cyoc%2Ftype-action-swipe.mp4 https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1gSz-L39Or4aM8GhQn0ZhnUkaV5E-cyoc%2Ftype-action-swipe.mp4

you should use this ItemTouchHelper 您应该使用此ItemTouchHelper

this gives swipe functionalty for recyclerView items 这为recyclerView项目提供了滑动功能

check out this Example 看看这个例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在RecyclerView中用滑动手势调整搜寻栏值 - Cannot adjust seekbar value with swipe gesture in RecyclerView 禁止水平回收视图收听垂直滑动手势 - Disallow horizontal recyclerview to listen to vertical swipe gesture 如何在Android Studio中的完整RecyclerView(不是项目)上实现向下滑动手势? - How to implement swipe down gesture on a complete RecyclerView (not an item) in Android Studio? Android Swipe手势和项目单击在RecyclerView中都无法一起使用 - Android Swipe gesture and item click both not working together in RecyclerView 检测 recyclerView 上的滑动手势时出现问题,MotionEvent e1 是 null? - Problem in detecting swipe gesture on recyclerView, MotionEvent e1 is null? Android-在表格行上滑动手势应该给我按钮以执行某些操作? - Android - swipe gesture on Table row should give me Button to perform certain actions? 如何在没有第三方库的RecyclerView项目上轻扫手势 - How to do swipe gesture on RecyclerView item without 3rd party lib 带有滑动手势的运动布局 + SwipeRefreshLayout + RecyclerView 错误向上滚动的错误行为 - Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up android滑动手势功能 - android swipe gesture functions 在Webview上检测滑动手势 - Detect a swipe gesture on webview
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM