- Home
- Forum
- Xamarin.Forms
- List item needs double tap on Samsung devices before ItemTapped is called
List item needs double tap on Samsung devices before ItemTapped is called
On Samsung devices ItemTappedCommand is only triggered after a double tap. How to solve this problem?
<sflistview:SfListView x:Name="DossierListView"
Grid.Row="0"
AutoFitMode="Height"
ItemsSource="{Binding Dossiers}"
SelectionMode="None">
<sflistview:SfListView.ItemSpacing>
<OnIdiom x:TypeArguments="Thickness">
<OnIdiom.Phone>5</OnIdiom.Phone>
<OnIdiom.Tablet>5</OnIdiom.Tablet>
<OnIdiom.Desktop>10</OnIdiom.Desktop>
</OnIdiom>
</sflistview:SfListView.ItemSpacing>
<sflistview:SfListView.Behaviors>
<b:EventToCommandBehavior Command="{Binding ItemTappedCommand}" Converter="{StaticResource ItemTappedConverter}" EventName="ItemTapped" />
</sflistview:SfListView.Behaviors>
<sflistview:SfListView.ItemTemplate>
<DataTemplate>
<controls:DossierViewCell />
</DataTemplate>
</sflistview:SfListView.ItemTemplate>
</sflistview:SfListView>
SIGN IN To post a reply.
5 Replies
GP
Gnana Priya Namasivayam
Syncfusion Team
July 5, 2018 01:18 PM UTC
Hi Guido,
Thanks for contacting Syncfusion support.
We have checked the reported query that `ItemTappedCommand is triggered after a double tap on Samsung devices`. Unfortunately, we couldn’t able to reproduce the issue.
We have attached a sample video link where tap command works normal when we load label inside the ItemTemplate.
Ensured Device Version: Samsung Galaxy S8+ 8.0.0
Could you please share the template that used DossierViewCell or a simple sample which replicates the issue which would highly help us to analyze it better at our end.
Regards,
Gnana Priya N
From: Gnana Priya Namasivayam
Sent: Thursday, July 5, 2018 5:08 PM
To: Jayaleshwari N <[email protected]>
Subject: Forum Review- F138502
Sent: Thursday, July 5, 2018 5:08 PM
To: Jayaleshwari N <[email protected]>
Subject: Forum Review- F138502
Hi Guido,
Thanks for contacting Syncfusion support.
We have checked the reported query that `ItemTappedCommand is triggered after a double tap on Samsung devices`. Unfortunately, we couldn’t able to reproduce the issue.
We have attached a sample video link where tap command works normal when we load label inside the ItemTemplate.
Could you please share the template that used DossierViewCell or a simple sample which replicates the issue which would highly help us to analyze it better at our end.
Regards,
Gnana Priya N
EM
Edward Mutsaers
July 5, 2018 02:04 PM UTC
Hi Gnana Priya,
The ViewCell code looks like this:
public class DossierViewCell : ViewCell
{
private CachedImage cachedImage;
private Label label;
private Frame frame;
public DossierViewCell()
{
this.frame = new Frame()
{
Margin = 0,
Padding = new Thickness(8, 5, 5, 5),
BackgroundColor = Statics.Palette.White,
CornerRadius = 0,
BorderColor = Statics.Palette.DarkBeige
};
var grid = new Grid();
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = 40 });
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Star });
// Set placeholder image that will be shown when image is loading or when downloading failed
var placeholderImage = Device.RuntimePlatform == Device.UWP ? "Assets\\dossier.png" : "dossier";
// Create image which will hold the logo of the organisation
this.cachedImage = new CachedImage()
{
Aspect = Aspect.AspectFit,
DownsampleToViewSize = true,
DownsampleUseDipUnits = true,
HeightRequest = 40,
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
WidthRequest = 40,
LoadingPlaceholder = placeholderImage,
ErrorPlaceholder = placeholderImage,
};
// Indicate where the image will be positioned in the grid
Grid.SetColumn(this.cachedImage, 0);
// Create labels which will hold the name, roles and organisation
this.label = new Label()
{
Margin = new Thickness(15, 0, 0, 0),
FontSize = 20,
TextColor = Statics.Palette.DarkGray,
VerticalOptions = LayoutOptions.CenterAndExpand
};
// Indicate where the stackpanel will be positioned in the grid
Grid.SetColumn(this.label, 1);
// Create arrow image
var image = new Image()
{
HeightRequest = 30,
HorizontalOptions = LayoutOptions.End,
VerticalOptions = LayoutOptions.Center,
WidthRequest = 30,
Source = Device.RuntimePlatform == Device.UWP ? "Assets\\arrow_right.png" : "arrow_right"
};
Grid.SetColumn(image, 1);
// Add images and stacklayout to grid
grid.Children.Add(this.cachedImage);
grid.Children.Add(this.label);
grid.Children.Add(image);
// Add grid to frame so we can show the content
frame.Content = grid;
// Add frame to ViewCell View
this.View = frame;
this.View.BindingContextChanged += View_BindingContextChanged;
}
private void View_BindingContextChanged(object sender, System.EventArgs e)
{
// Remove old image
this.cachedImage.Source = null;
var frame = sender as Frame;
if (frame == null)
return;
var dossier = frame.BindingContext as Dossier;
if (dossier == null)
return;
this.cachedImage.Source = dossier.ThumbnailUrl;
this.label.Text = dossier.Title;
}
}
GP
Gnana Priya Namasivayam
Syncfusion Team
July 6, 2018 01:19 PM UTC
Hi Guido,
Sorry for the inconvenience.
We have checked the reported query `ItemTappedCommand is only triggered after a double tap` by using DossierViewCell. Unfortunately, we could not notice the reported issue at our end.
We have ensured the reported query in below device configuration.
- Samsung Galaxy S8 with 8.0.0 API 26
- Samsung Galaxy S6 6.0.1 with API 23.
- Android SDK version : 25.2.5
Could you please share the details about the device configuration you have checked or Can you please replicate the issue in our sample which would highly help us to analyze it better at our end.
Sample Link : http://www.syncfusion.com/downloads/support/forum/138502/ze/ListViewSample-F138502-31087545
Regards,
Gnana Priya N
EM
Edward Mutsaers
July 11, 2018 04:00 PM UTC
Hi Gnana Priya,
Attachment: ListViewSampleF13850231087545_764222b5.zip
Found out what the problem is. If we use SfListView without pull to refresh then there is no problem. However when the SfListView is put inside SfPullToRefresh the double tap is needed on Samsung devices. The strange thing is that the double tap is then handled as two single taps (so the action is executed twice).
I've edited the sample to include the pull to refresh component.
Thanks,
Guido
Attachment: ListViewSampleF13850231087545_764222b5.zip
VR
Vigneshkumar Ramasamy
Syncfusion Team
July 12, 2018 12:56 PM UTC
Hi Guido,
We have created an incident under your account for this query and you can follow up the same for further details.
Regards,
Vigneshkumar R
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
EM Edward Mutsaers
- Jul 3, 2018 01:53 PM UTC
- Jul 12, 2018 12:56 PM UTC