xamarinFastCell icon indicating copy to clipboard operation
xamarinFastCell copied to clipboard

How to use ItemAppearing with FastCell?

Open JoshuaNovak919 opened this issue 9 years ago • 8 comments

I am trying to use ItemAppearing with FastCell, but it doesn't ever seem to call the method I tell it to call (it was working before I switched to FastCell). Any idea on how to get this to work?

JoshuaNovak919 avatar Jul 26 '15 07:07 JoshuaNovak919

Why do you want that method out of interest? I only ever need the prepare cell override. If I can better understand your use case I can cater for it.

Sent from my iPhone

On 26 Jul 2015, at 02:48, JoshuaNovak919 [email protected] wrote:

I am trying to use ItemAppearing with FastCell, but it doesn't ever seem to call the method I tell it to call (it was working before I switched to FastCell). Any idea on how to get this to work?

— Reply to this email directly or view it on GitHub.

georgejecook avatar Jul 26 '15 13:07 georgejecook

@georgejecook I am using it for infinite scrolling right now and I may add some effects like a scale up as the items scroll into view.

JoshuaNovak919 avatar Jul 26 '15 17:07 JoshuaNovak919

Can you show me an example in your code please?

It also doesn't sound right to me for infinite scrolling. Why are you not lowest ring to the scroll event of the list to work out where it is in the list? That's the correct way to to that.

Sent from my iPhone

On 26 Jul 2015, at 12:30, JoshuaNovak919 [email protected] wrote:

@georgejecook I am using it for infinite scrolling right now and I may add some effects like a scale up as the items scroll into view.

— Reply to this email directly or view it on GitHub.

georgejecook avatar Jul 26 '15 17:07 georgejecook

I went based off this tutorial:

http://motzcod.es/post/107620279512/load-more-items-at-end-of-listview-in

I check to see if it's the last item or close to the last item in the list and then I pull more from the server.

JoshuaNovak919 avatar Jul 26 '15 17:07 JoshuaNovak919

Ok thanks. I think that's a jacket and inefficient way of doing it but regardless there's no reason why you still can't do the same thing. The setup cell method I called whenever an item is appearing do why not just use that method instead of viewappearing?

georgejecook avatar Jul 26 '15 19:07 georgejecook

It's a lazy implementation though. When I get time I'll add a grown up way of doing it to the samples.

georgejecook avatar Jul 26 '15 19:07 georgejecook

@georgejecook Ok sounds great. Thanks for the help. I'll try giving that a shot shortly.

JoshuaNovak919 avatar Jul 26 '15 20:07 JoshuaNovak919

@JoshuaNovak919 found myself needing OnItemAppearing to fire as well. Check out

https://github.com/paulpatarinski/ModernDirectory/blob/master/iOS/Renderers/FastCellRenderer.cs

and

https://github.com/paulpatarinski/ModernDirectory/blob/master/ModernDirectory/CustomControls/Cells/FastCell.cs

I have also added a slightly better implementation of the Infinite scroll :

https://github.com/paulpatarinski/ModernDirectory/blob/master/ModernDirectory/CustomControls/ExtendedListview.cs

which includes PageSize, Page Number and Offset. With those 2 I was able to get Infinite scroll working. Let me know if it is not working for you.

DISCLAIMER : Code was written at 1:30am

paulpatarinski avatar Aug 10 '15 06:08 paulpatarinski