MultiSnapRecyclerView icon indicating copy to clipboard operation
MultiSnapRecyclerView copied to clipboard

Alternatives to msrv_speed_ms_per_inch

Open mvgreen opened this issue 4 years ago • 3 comments

Hello and thank you for your library, it helped me a lot! However, I found an issue in your implementation. In fact there are two issues in one:

  1. ms/inch is not a speed, it's inversion of speed, so the word "speed" in the attribute name is very confusing;
  2. It would be better to have some alternative attribute to define constant snap time.

I'll explain the second issue as it is more important. If you swipe your recyclerview on a small screen in portrait mode with (for example) msrv_speed_ms_per_inch=50, it will change the page pretty fast. But if you'll try it on a bigger device (on a tablet), it will scroll really slow, because it has a larger surface and it takes more time to reach target point.

Instead, it would be better to declare a constant time for snap helper, that will be equally fast on both devices.

mvgreen avatar Mar 17 '20 15:03 mvgreen

Sorry for the late replay and thank you for the suggestion.

Can I ask about No2 a bit more to make it clear?

it will scroll really slow, because it has a larger surface and it takes more time to reach target point.

I feel, regardless of the orientation, the distance between the current-selected position and the next target point is the same. Let's say, msrv_speed_ms_per_inch=50 and snap_count=2 and the selected item is on index 4. If you scroll to right, it will snap to index 6. Since the distance between the item on index 4 and index 6 is the same on any orientation (as long as the size of each item is the same.), it will take the same amount of time. (I'm trying to reproduce it on demo app, but could not reproduce it.)

Or when you are talking about the bigger device, it has bigger items than a smaller device?

TakuSemba avatar Sep 03 '20 01:09 TakuSemba

Yes, in my case items had "match_parent" width and so they were bigger when I change orientation to landscape, for example.

mvgreen avatar Sep 04 '20 11:09 mvgreen

I see. I understand your use case.

I will try and see if I can handle that use case and get back to you.

TakuSemba avatar Sep 06 '20 14:09 TakuSemba