RedReader icon indicating copy to clipboard operation
RedReader copied to clipboard

Cancellable fling actions

Open Roy-Orbison opened this issue 5 years ago • 1 comments

When flinging/swiping on items to vote, etc., the action is successful as soon as the threshold distance has been reached. This is contrary to basically every other app with swipe actions, including native android apps and this app's own pull-down-to-refresh feature.

The typical convention is for a fling/swipe action to be successful only if the item is released whilst past the threshold. If the item is returned towards its original position, goes back below the threshold, and then released, the action is cancelled.

Making this consistent with other apps would prevent having to perform corrective votes if a swipe is accidental or in the wrong direction.

Roy-Orbison avatar Nov 21 '20 18:11 Roy-Orbison

Firstly, I think the items in OP refers to the posts and comments displayed in the app.

I would really like to see this implemented as well. It appears that using androidx.recyclerview.widget.ItemTouchHelper to handle swipes would give the app this behaviour. This could be attached to the existing RecyclerViews in PostListingFragment and CommentListingFragment. The icon and text displayed when swiping (ie. the two right-facing triangles and action text like "UPVOTE") could be drawn by ItemTouchHelper.onDraw().

However, the app currently has some custom logic to handle swiping implemented inside SwipableItemView, independent of any RecyclerView. @QuantumBadger Is it required to support swiping on the posts and comments directly?

nik0sc avatar Jun 08 '21 17:06 nik0sc