georgejecook / xamarinFastCell

fast view cell implementation for iOS that's really performance friendly, yet allows you to write cells in xaml.
Apache License 2.0
39 stars 8 forks source link

How to use ItemAppearing with FastCell? #1

Open JoshuaNovak919 opened 9 years ago

JoshuaNovak919 commented 9 years ago

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?

georgejecook commented 9 years ago

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 notifications@github.com 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.

JoshuaNovak919 commented 9 years ago

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

georgejecook commented 9 years ago

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 notifications@github.com 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.

JoshuaNovak919 commented 9 years ago

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.

georgejecook commented 9 years ago

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 commented 9 years ago

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

JoshuaNovak919 commented 9 years ago

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

paulpatarinski commented 9 years ago

@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