ItemTapCommand in GridCollectionView is not working properly
Bug Information
ItemTapCommand not working properly .On click on cell some times it did not execute command and some times it execute the command.Assume if cell is clicked 10 times then command would executes 4 or 5 times.
Expected Behavior
Every time when cell is clicked it should execute the attached command.
Environment
Version Number of Plugin: 0.3.0-pre Device Tested On: Xolo era Xpro Visual Studio 2017 for Mac : v7.8 Version of Xamarin: 3.6.0
@TheAlphamerc Thank you for your report. I will survey it a little later.
@TheAlphamerc I regret to say that I was not able to reproduce that issue. It works that in my environment. Did you try ver.0.3.10-pre?
Could you please tell me detail information a little more?
@muak It doesn't work for me on Android. iOS works fine.
<ai:GridCollectionView
ItemsSource="{Binding Posts}" GridType="UniformGrid" PortraitColumns="3"
ItemTapCommand="{Binding ItemSelectedCommand}" Margin="0,10,0,10" HeightRequest="{Binding ListViewHeight}">
<ListView.ItemTemplate>
<DataTemplate>
<ai:ContentCell>
<ffimageloading:CachedImage LoadingPlaceholder="blank.png"
DownsampleToViewSize="true" DownsampleHeight="70"
Aspect="AspectFit" Source="{Binding PostImageUrl}"
effects:LongPressedEffect.Command="{Binding LongPressCommand}">
<ffimageloading:CachedImage.Effects>
<effects:LongPressedEffect />
</ffimageloading:CachedImage.Effects>
</ffimageloading:CachedImage>
</ai:ContentCell>
</DataTemplate>
</ListView.ItemTemplate>
</ai:GridCollectionView>
My ItemSelectedCommand does not get called on Android. Running version 0.3.10-pre
Actually, it seems as though the CachedImage is stealing the tap. If I put a label in the ContentCell, i can tap on the text and it works, but tapping on the image does not.
Not sure what to do now.
@eclipsed4utoo Thank you for your report. I tried putting a CachedImage directly in a ContentCell. And it worked. I think it occurs a conflict between your LongPressedEffect and CollectionView tap command.
@muak yeah that was the issue. At the time, I was switching between a couple of different similar collection views, so I was using the LongPressEffect. Once I noticed that the GridCollectionView handled long presses, I switched to using that and everything started working fine.
@eclipsed4utoo It was good! Thanks.
I encountered this issue in my project certainly. This issue seems to occur when using the grouping. But I don't still know how to reproduce it.