Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add more gesture options #81

Open
isenbj opened this issue Jun 23, 2023 · 5 comments
Open

[Feature Request] Add more gesture options #81

isenbj opened this issue Jun 23, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@isenbj
Copy link

isenbj commented Jun 23, 2023

I would like to have more gestures for each grid item.

For my project, I want to be able to tab a grid entity, scroll in the grid with my finger, hold for a set amount of time (say 200 ms) and start a reorder, but hold longer (say 500 ms) and run a function (say switch the grid from reorderable, to selectable)

Right now, if I enableLongPress, then I cannot have a gesture detector in my grid with a LongPress to switch the grid to a selectable grid. I can set enableLongPress to false, but I can no longer scroll with 1 finger and have to use 2.

summary of desired behavior:
tap => run function (handled with a gesture detector in the grid children)
drag finger in grid => scrolls up or down with single finger
short press (200 ms) => start dragging
long press (500 ms) => run function (can be in gesture detector, but blocked by the LongPressDraggable)

@karvulf karvulf added the enhancement New feature or request label Nov 17, 2024
@karvulf
Copy link
Owner

karvulf commented Nov 17, 2024

Hello @isenbj
If I understand it correclty, you want the following:

  1. While you are dragging an item, you want to scroll with the other finger through your GridView?

  1. you want to define specific events depending on the duration of your press
  • e.g. a map where you have all kinds of duration and if this duration was hit by pressing the child, then you want to do something else?
  • I think what could be possible that you could use the function onDragStart which gives you a duration of the press and if you return false, then you can run another function and the drag wouldn't start or you return true which tells that the drag can be done.

@isenbj
Copy link
Author

isenbj commented Nov 17, 2024

Hey, it has been over a year since I wrote this, So I need to remember right :D

1: Correct. On say an iPad, it would be nice to drag an item and scroll with the other finger to where I want it. Say for a very large grid.
2: Image a reorderable AND selectable grid. Currently, no matter how long you hold on an item it will just start the reorder process. I amagine a situation where you can long press, and that would select the item rather than begin reordering it.

so:
tap: perform a tap gesture
instant drag: would scroll the list
hold with small delay: begin dragging for reorder
hold with longer delay: begin selecting

@karvulf
Copy link
Owner

karvulf commented Nov 17, 2024

Sry for that, I was going through the issues and tried to solve some 😅 @isenbj
What would be your goal of selecting these items?

@isenbj
Copy link
Author

isenbj commented Nov 17, 2024

For example, I have a grid of photos. They can be reordered, but I also want to select them to delete, change category, etc. as it is now, I need to tap a select button, which will remove the reorderable grid and replace it with a selectable one.

@karvulf
Copy link
Owner

karvulf commented Nov 20, 2024

I see I will think about a solution for that @isenbj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants