Changed ListView to CollectionView
I copied a screen from one of my current apps into the project including SVG images, converters, models and a cut down version of my ViewModel that fakes the data. Then I changed it to use a CollectionView instead of a ListView.
I don't have a Mac for iOS development so I've only tested the Android implementation.
Screenshots
I couldn't embed them in the PR but videos taken on a Galaxy S6 Edge (Android 7.0) are visible in the master branch of my fork.
What went well?
Apart from one issue due to syntactic differences it was simple to convert from a ListView to a CollectionView. For this particular use case performance is good and visually they look the same apart from the lack of a scrollbar on the CollectionView.
What didn't go well?
I ran into one issue - ListView DataTemplates use a ViewCell, CollectionView DataTemplates do not. Unfortunately VS2019 did not spot anything wrong but at runtime Mono threw an Invalid Cast exception and closed the app. The exception confused me for a while until I looked at the docs more closely. This would not have been an issue if I was creating a new screen using CollectionView rather than converting one from a ListView.
How is the performance?
This screen does not have a lot of data to display but each cell is quite complicated with two SVG images. Performance seems similar for both implementations as shown in the videos.
Missing or Desired Things:
One thing that concerns me is the recycling strategy. In this example I didn't have any issues but I recently tried the same process but converting a Bindable FlexLayout to a CollectionView in a demo app. It did not go well. CollectionView was not the right choice of control for that screen but also I had problems with text appearing and dissapearing when scrolling. If it were a ListView I would have turned off recycling.
Hi @irongut, sorry for the long delay in response. Your feedback here is really appreciated and I've made note of all the individual responses for future planning on CollectionView. We added a survey later on for sending out stickers to participants, so if you'd be interested, please get in touch with me at [email protected] with contact info on where we can send them, and we'll try to get you taken care of as well. Thanks!
@pauldipietro I did fill in a survey but I'll drop you an email as well just in case. Thanks.