Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemTapCommand in GridCollectionView is not working properly #8

Open
TheAlphamerc opened this issue Apr 8, 2019 · 8 comments
Open

Comments

@TheAlphamerc
Copy link

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

@muak
Copy link
Owner

muak commented Apr 10, 2019

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

@muak
Copy link
Owner

muak commented Apr 17, 2019

@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?

@eclipsed4utoo
Copy link

eclipsed4utoo commented Jun 13, 2019

@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
Copy link

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.

@muak
Copy link
Owner

muak commented Jun 27, 2019

@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.

@eclipsed4utoo
Copy link

@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.

@muak
Copy link
Owner

muak commented Jun 28, 2019

@eclipsed4utoo
It was good!
Thanks.

@muak
Copy link
Owner

muak commented Aug 12, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants