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

How get cell swipe gesture working in android when ListView is in TabbedPage?

4 Answers 224 Views
ListView
This is a migrated thread and some comments may be shown as answers.
VincentH
Top achievements
Rank 1
VincentH asked on 10 Oct 2016, 09:58 AM

When I put a ListView in a TabbedPage on Android (using AppCompat), the TabbedPage enables swipe through its tabs left and right. However this overrides the swipe gesture handling of the ListView.

As a consequence, when the ListView is in the leftmost Tab, you can swipe the cell to the right but a swipe to the left on the swiped cell does a tab swipe to the next tab instead of unswipe the cell.

When the ListView is in any other tab than the leftmost, a right swipe moves to the previous tab so cell swipe is not accessible at all.

(How) is it possible to have the ListView swipe gesture take precedence over the TabbedPage swipe gesture? I.e. swiping on the list will do a cell swipe, and swiping outside the list will do a tab swipe.

Even better would be when swiping to the right on an already right-swiped cell would bubble up to the tab right swipe, and similarly swiping to the left on an unswiped cell would bubble up to the tab left swipe.

PS: I did find an ugly hack to disable swiping on the TabbedPage which allows the cell swipe to work on Android, but I prefer a solution that does not cripple the TabbedPage (see https://forums.xamarin.com/discussion/comment/205661/#Comment_205661)

4 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 12 Oct 2016, 10:47 AM
Hello,

It seems that the XamarinForms TabbedPage does not feature changing the pages using swipe by default. Could you double check if the exact and default XamarinFomrs TabbedPage is used in your particular scenario?

Regards,
Pavel R. Pavlov
Telerik by Progress
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
VincentH
Top achievements
Rank 1
answered on 12 Oct 2016, 01:42 PM

I am using a standard TabbedPage; the swipe gesture is added to that automatically when you use android AppCompat to support Material Design as described here: https://developer.xamarin.com/guides/xamarin-forms/platform-features/android/appcompat/

There is no custom code involved; the swipe is a standard Android feature that gets enabled when using AppCompat, which is recommended best practice for new android apps.

0
Accepted
Pavel R. Pavlov
Telerik team
answered on 17 Oct 2016, 08:16 AM
Hello,

It is great that customers are reading and applying the promoted practices. It is true that the swipe navigation between tabs is recommended but it also is mentioned in which cases such navigation should be used. Please take a closer look at the "When to use" section of the material design. There you will find the following:

"Don't use tabs with content that supports the swipe gesture, because swipe gestures are used for navigating between tabs. "

This means that if you are willing to follow the material design the design of the application should be changed.

Regards,
Pavel R. Pavlov
Telerik by Progress
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
VincentH
Top achievements
Rank 1
answered on 21 Oct 2016, 11:04 AM
Thanks for you advise, I agree it is a more consistent UX to have the swipe gesture mean only one thing in a Tab. I used the swipe cel to add action buttons to the cell, but an alternative design would be to have the buttons visible in a smaller format at the bottom of each cell - like e.g. in the Android Twitter app. 
Tags
ListView
Asked by
VincentH
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
VincentH
Top achievements
Rank 1
Share this question
or