This is a migrated thread and some comments may be shown as answers.

Prevent swipe direction

3 Answers 121 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 15 Mar 2016, 08:01 PM

Docs show items can be swiped left and right, I just want to limit it to swipe right, and not ever have it "stick" open... do you know what I mean?  Like if swiped 50% over, then preform the swipe end action?

Struggling with this a bit...

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 18 Mar 2016, 03:19 PM
Hell Steve,

Take a look at the source of one of RadListView's examples in {N}'s marketplace demo:

https://github.com/NativeScript/nativescript-marketplace-demo/blob/production/app/examples/listview/reorder/listview-reorder.ts

You can try setting the corresponding property of the swipeLimits object to 0 to prevent the item from being swiped in the given direction:

export function onItemSwipeProgressStarted(args: listViewModule.ListViewEventData) {
    args.data.swipeLimits.threshold = todoList.getMeasuredWidth() * utils.layout.getDisplayDensity();
    args.data.swipeLimits.left = 350 * utils.layout.getDisplayDensity();
    args.data.swipeLimits.right = 350 * utils.layout.getDisplayDensity();
}

I hope this helps.

Regards,
Deyan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 31 Mar 2016, 04:43 PM

Were can we do a feature request to move this to a root level API setting?  Maybe like swipeDirection="Both" ("Left" or "Right")

0
Nikolay
Telerik team
answered on 06 Apr 2016, 07:42 AM
Hi Steve,

You can use the following dedicated github repository to submit feature requests and confirmed issues: https://github.com/telerik/nativescript-ui-feedback.

Regards,
Nikolay
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Deyan
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Nikolay
Telerik team
Share this question
or