SwipeRevealLayout icon indicating copy to clipboard operation
SwipeRevealLayout copied to clipboard

Less sensitive to user touches

Open samoilovich opened this issue 9 years ago • 12 comments

Hello, I'm Natali.

I have some question about swiping item when RecyclerView starts scrolling. When I starts scrolling list or try to click item pretty often item start dragging . See small video. https://drive.google.com/file/d/0B3hDpYmjmuijanZ0bDlvbjZPN2c/view?usp=sharing May be I should config some option for SwipeRevealLayout to prevent dragging item or do item less sensitive to user touches? Please can you can help me?

Thanks

P.S. And thanks for your good library

samoilovich avatar Jul 07 '16 11:07 samoilovich

Hi Natali,

I was thinking about that when I started working on this project. I actually implemented the sensitive setting, but I removed it because I tested on some devices and found out it already had acceptable sensitivity for most scroll/fling gestures. That may not be true for other devices or layouts, so I will consider implementing the sensitive feature again in the next version.

chthai64 avatar Jul 07 '16 15:07 chthai64

Thanks for your quick answer! Do you have any predictions about next version release?

samoilovich avatar Jul 07 '16 15:07 samoilovich

The sensitive feature is a simple one to implement so I can do it within few days.

chthai64 avatar Jul 07 '16 17:07 chthai64

I just added a version #20 app:minDistRequestDisallowParent, the higher the distance you set, the less sensitive the RecyclerView is. It basically means the min distance to swipe until the RecyclerView (or other parent view) cannot be scrolled.

chthai64 avatar Jul 08 '16 17:07 chthai64

Hello. Sorry, for delay.

I was testing app:minDistRequestDisallowParent with different values. Results can be found with a following link: https://drive.google.com/folderview?id=0B3hDpYmjmuijZkNhOENjNG03Wms&usp=sharing (The name of video is vlue of this attribute)

And behavior with values in range 5dp-100dp is similar. I can be wrong, of course. I want to ask you about restrictions on this attribute. I mean this attribute has max value? Or may be I set not appropriate values?

Thanks a lot! P.S. Does a link open correctly? P.P.S. If not, please try to cope the link and open in a new tab by pasting in url field.

samoilovich avatar Jul 13 '16 11:07 samoilovich

The higher the value, the less sensitive the swipe layout is. You initially said:

When I starts scrolling list or try to click item pretty often item start dragging .

From my understanding, you can't scroll the list because the items get dragged. So setting it to a high value (20 dp), you can scroll the list without having items dragged.

chthai64 avatar Jul 13 '16 14:07 chthai64

But if I set app:minDistRequestDisallowParent="2000dp" I have similar behavior without settings of this attribute. Please, see video https://drive.google.com/file/d/0B3hDpYmjmuijZkliN2dBMlRWLVE/view?usp=sharing Should I set higher valur of minDistRequestDisallowParent?

samoilovich avatar Jul 13 '16 14:07 samoilovich

From the video, you was able to scroll the list without having intercepted by dragging the item. Very large value like 2000 dp means than the RecyclerView will not be scroll-locked when you drag the item (unless you swipe the item more than 2000 dp, which is not possible).

chthai64 avatar Jul 13 '16 15:07 chthai64

But my problem is small movements of items when I start scrolling (not stop of scrolling at all). It can be called UI enhancement. Do you see red background of item (which is disappeared when finger moves to other item) when I start scrolling RecyclerView? I asked you can I prevent that movements of items.

May be I explain my problem not clearly. Sorry, for my English.

samoilovich avatar Jul 13 '16 15:07 samoilovich

I see what you are talking about. That is a pretty hard issue to solve. My current method is to allow the item to move, if it moves pass a certain distance then lock the RecyclerView scrolling. The downside is you can see a small movement of the item. Currently it's the limitation of this lib. Other solution that I can think of is to compute the swipe angle, but that's not trivial to implement. I may consider working on that in the future.

chthai64 avatar Jul 13 '16 15:07 chthai64

Thanks

samoilovich avatar Jul 18 '16 08:07 samoilovich

Hello, your library works really well except this one problem which is reviewed in this thread, have you found any solution to prevent views of a list from sliding while scrolling(detecting drag while scrolling)? I have read all of the above and I think that changing swipe angle is the best solution but the main problem is how to implement it? Thank you for your work.

Aleksandr1990mn avatar May 17 '17 13:05 Aleksandr1990mn