You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request; To allow swipe in only one direction for Rows (or both depending on the requirements). This would mean replacing hasActions with two methods: swipesLeft and swipesRight:
// Example Implementation@OverridepublicbooleanswipesLeft(intposition) {
// Swipe Left for only Odd Rowsreturnposition % 2 == 1;
}
@OverridepublicbooleanswipesRight(intposition) {
// Swipe Right for only Even Rowsreturnposition % 2 == 0;
}
The text was updated successfully, but these errors were encountered:
I don't think it is possible to do this properly using hasActions. hasActions is called when you touch a row, before you are actually swiping. I only know the direction when the swipe starts. If I'd want to implement something like this that leaves me two options:
Visualize the swipe and stop it if hasActions returns false on the current direction, which would give this weird bumping effect
Wait until after hasActions comes back before visualizing the swipe, but that might feel laggy (this is conjecture though, I haven't tried it)
I'm also not convinced that this leads to a good user experience. I've personally always hated apps that allow me to swipe on a list row in one direction but not another.
sheharyarn
changed the title
Feature Request: Enable/Disable swipe in one direction depending on position
Enable/Disable swipe in one direction depending on position
Jan 18, 2015
This is a feature request; To allow swipe in only one direction for Rows (or both depending on the requirements). This would mean replacing
hasActions
with two methods:swipesLeft
andswipesRight
:The text was updated successfully, but these errors were encountered: