Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
_Work in progress. Do not merge._
This is a difficult problem to generalize for all layouts. I was discussing this with Marc Haisenko, and it clarified a couple things for me.
There should probably be two types of reordering. I'll paste what Marc aptly wrote:
To me, it seems like the default type here should be displacement. The reasoning for that is that drawing a marker can really only be generalized to linear layouts. Displacement should theoretically work for all types of layouts.
There are many components that need to go into this. My proposal is this.
JNWCollectionViewReorderableLayout
This will be a subclass of the regular layout. This would encapsulate many of the patterns that are in common with all types of drag and drop operations. Any layouts that want to opt-in to reordering can then subclass this class instead of
JNWCollectionViewLayout
. This class will be responsible for handling all aspects of both marker and displacement-based layouts. That means that in the case of displacement-based layouts it will take any layout attributes it receives from any subclasses and will modify those as necessary to displace elements.Now here come the more interesting questions that I haven't figured out yet.
(Fixes #11)