AiForms.CollectionView icon indicating copy to clipboard operation
AiForms.CollectionView copied to clipboard

ItemTapCommand in GridCollectionView is not working properly

Open TheAlphamerc opened this issue 7 years ago • 8 comments

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 avatar Apr 08 '19 04:04 TheAlphamerc

@TheAlphamerc Thank you for your report. I will survey it a little later.

muak avatar Apr 10 '19 01:04 muak

@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 avatar Apr 17 '19 02:04 muak

@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

eclipsed4utoo avatar Jun 13 '19 00:06 eclipsed4utoo

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 avatar Jun 14 '19 04:06 eclipsed4utoo

@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 avatar Jun 27 '19 01:06 muak

@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 avatar Jun 27 '19 11:06 eclipsed4utoo

@eclipsed4utoo It was good! Thanks.

muak avatar Jun 28 '19 01:06 muak

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.

muak avatar Aug 12 '19 03:08 muak