-
Notifications
You must be signed in to change notification settings - Fork 85
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
Animate insertions and deletions. #69
Comments
NB: This comment is going to be a bit disjointed as I'm still undecided on a large portion of this API. So this is quite a difficult problem to solve well. If the cells weren't reusable it would really be a piece of cake, but alas they are reusable. The problem with implementing this is that keeping track of state becomes a nightmare.
... and
Both work reliably. However, there are two significant drawbacks to creating the API like this for
What does this ideal API look like? Ideally it would be much more minimal than the current standards for granular updates. An initial approach would be to force the user to store their models in some sort of collection which we could then observe and perform diffs on when any sort of update occurs. However, this too is not a good approach since it forces the user to keep their data in memory, which would naturally be an issue for larger amounts of data. Jumping abruptly from the public API, the internal implementation should most likely be based around the traditional changesets approach, no matter where we're getting the change notifications. The challenge is keeping track of the following:
Jumping again to the animation side of things, I think
However, I think one issue that I have with the API is that it does not offer a way to customize the animations beyond adjusting the layout attributes. For example, let's way I wanted to insert a cell with a spring animation. With To add a bit more flexibility we'd need to be able to let users define their own animations. One approach to this would be to use the current API Well that concludes the random jumble of thoughts I have about this. It really opens more questions than answers, but I want to think this through carefully before taking the more traditional approach to an API this important. |
We have very rudimentary support for this in our branch (https://github.com/chriseidhof/JNWCollectionView/tree/item-spacing) it only works for one section. The code is still complex, we can simplify this a bit more. We did decide to use the UICollectionView API. |
@chriseidhof Looks very interesting! In case you all don't plan on continuing to work on that any more, I might pick up from where you left off once I have the motivation to get working on implementing this. |
@jwilling currently, we're focused on shipping our product, and we probably won't have set apart time in the next months to clean it up and make it work for any use case. (e.g. section support, etc.). |
@chriseidhof No problem at all, I understand. |
I think we should have support for animated insertions and deletions.
Probably a first step is to have support for the following methods (just like UICollectionView):
And
However, I haven't read through the internals of JNWCollectionView, so any ideas about how to implement this are very welcome.
The text was updated successfully, but these errors were encountered: