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: additional funtionality #56

Merged

Conversation

darrynten
Copy link
Contributor

Return directionX and directionY in the getAbsoluteMovement() method.

Return the x and y direction with beforeswipe. Enables developers
to make better decisions when receiving this event.

Refactored swipe event with a much simpler velocity calculation.

Use the direction from the new getAbsoluteMovement() method instead of recalculating in the swipe event. Fixes a bug where the direction for a right swipe would sometimes be reported as a left swipe. This was due to the direction calculation that has now been replaced in the swipe event's onEnd method.

Ability to define a "keep swiping" trigger point to be passed in to the constructor that lets you set a percentage (in terms of how far out the left- or rightmost edge of the list item has moved across the width of the list) that will trigger a swipe regardless of velocity. This allows a user to swipe out past x percent, think for a while, and if they still want it to swipe out let go and have it swipe out if past the minimum percent. Makes the swiping gestures behave more like they do in native Android applications.

The default value for swipe percent is 0 if it is missing, which returns false for the check.

Fixed a bug with the assignment of options in the constructor.

Configurable velocity and time for swipe with defaults for when these configurable options are not present which match the original settings.

Darryn Ten added 5 commits September 21, 2015 10:24
Return `xDirection` and `yDirection` in the `getAbsoluteMovement()` method.
Return the direction of the swipe in the `beforeswipe` event. Enables developers
to make better decisions when receiving this event.

Renamed `xDirection` and `yDirection` to `directionX` and `directionY`.
Much simpler velocity calculation.

Use the direction from the new `getAbsoluteMovement()` method instead of
recalculating.

Fixes a bug where the direction for a right swipe would sometimes be reported
as a left swipe. This was due to the direction calculation that has been
replaced in the `swipe` event's `onEnd` method.
Allow an optional `keepSwipingPercent` to be passed in to the constructor that
lets you set a percentage (in terms of how far out the left- or rightmost edge
of the list item has moved across the width of the list) that will trigger a
swipe regardless of velocity. This allows a user to swipe out past x percent,
think for a while, and if they still want it to swipe out let go and have it
swipe out if past the minimum percent. Makes the swiping gestures behave more
like they do in native Android applications.

The default value for swipe percent is 0 if it is missing, which returns false
for the check.

Use the direction returned from the `getAbsoluteMovement()` method instead of
re-calculating.

Fixed a bug with the assignment of options in the constructor.
Added options to change the values for min velocity and for min swip time.

Added defaults for when these new options are not present.
@darrynten
Copy link
Contributor Author

Resolves #42

@mauron85
Copy link

Looking great. +1

kornelski added a commit that referenced this pull request Sep 21, 2015
@kornelski kornelski merged commit 6fec52c into kornelski:master Sep 21, 2015
@kornelski
Copy link
Owner

Cool! Thanks.

@darrynten
Copy link
Contributor Author

Happy to help. We may have some more improvements to submit in the future. Thanks for the great library.

@darrynten darrynten deleted the feat/additional-funtionality branch September 21, 2015 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants