Skip to content
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

[WIP] FastAdapter v3 refactor #443

Merged
merged 89 commits into from
Oct 29, 2017
Merged

[WIP] FastAdapter v3 refactor #443

merged 89 commits into from
Oct 29, 2017

Conversation

mikepenz
Copy link
Owner

@mikepenz mikepenz commented Jun 4, 2017

TEST

You can currently try the v3 snapshot using the following dependency:

compile('com.mikepenz:fastadapter:3.0.0.7-SNAPSHOT@aar') {
    transitive = true
}
// 3.0.0.7-SNAPSHOT is also available for `fastadapter-commons`, `fastadapter-extensions`, `fastadapter-extensions-expandable`

WARNING not yet updated for v3.0.0.7
As the APIs changed quite a lot there are compat releases for the MaterialDrawer, and the AboutLibraries

compile('com.mikepenz:materialdrawer:6.0.0.6-SNAPSHOT@aar') {
        transitive = true
}
compile('com.mikepenz:aboutlibraries:6.0.0.6-SNAPSHOT@aar') {
        transitive = true
}

CHANGELOG

  • the IAdapter and all it's implementation's are no extending RecyclerView.Adapter
  • remove the concept of wrapping from the core library
  • the FastAdapter will now directly be initialized with the adapters it should use (in addition you can add new ones at a later point)
  • we no longer have an order in our adapters --> we no longer need a Footer or HeaderAdapter (just add your adapters in the order you need them)
  • simplify AbstractAdapter
  • simplify adapters access in the FastAdapter
  • simplify DragDropUtil --> it only needs the ItemAdapter, as this one already notifies automatically when the move method is used
  • temporary disable realm and firebase extensions
  • move listeners and their implementations to seperate classes / files
  • make sure the normal bindViewHolder call is not called if legacyBindViewMode is activated (to prevent twice the binds) ^^
    • this is anyways just a hack for the weird case of a library not properly implementing the onBindViewHolder method (in case we depend on the event being forwarded to us..)
  • add FastAdapter to the OnCreateViewHolderListener methods so it is properly possible to get the handled TypeInstance from the viewType and it's parent
  • add getEventHooks() method
  • adjust sample with the moved Listeners
  • adjust test as we need a view inside the ViewHolder to set the Tag
  • update to new compatible MaterialDrawer SNAPSHOT
  • implement initial Extension functionality
    • implement IAdapterExtension interface
    • implement ExpandableExtension
      • move all expandable depending logic to the extension
  • update sample app and MaterialDrawer to support the extension
  • fix test, as selectable has to be true to enable selecting
  • remove the positionBasedStateManagement, it's just unnecessary code overhead, and hard to maintain
    • the identifierBasedStateManagement has many advantages and it's only overhead is that we have to run once over the whole list of items (in the worst case)
  • fix issue with the SelectExtension not getting properly initialized
  • simplify getSelectedItems and getSelections
  • remove no longer needed util functions

@mikepenz mikepenz added this to the v3.0.0 milestone Jun 4, 2017
mikepenz added 10 commits June 7, 2017 10:53
…erView.Adapter`

* remove the concept of wrapping from the core library
* the FastAdapter will now directly be initialized with the adapters it should use (in addition you can add new ones at a later point)
* we no longer have an order in our adapters --> we no longer need a Footer or HeaderAdapter (just add your adapters in the order you need them)
* simplify AbstractAdapter
* simplify adapters access in the FastAdapter
* simplify DragDropUtil --> it only needs the ItemAdapter, as this one already notifies automatically when the `move` method is used
* temporary disable realm and firebase extensions
* make sure the normal bindViewHolder call is not called if legacyBindViewMode is activated (to prevent twice the binds) ^^
  * this is anyways just a hack for the weird case of a library not properly implementing the `onBindViewHolder` method (in case we depend on the event being forwarded to us..)
* add FastAdapter to the `OnCreateViewHolderListener` methods so it is properly possible to get the handled TypeInstance from the viewType and it's parent
* add getEventHooks() method
* adjust test as we need a view inside the ViewHolder to set the Tag
* update to new compatible MaterialDrawer SNAPSHOT
  * implement `IAdapterExtension` interface
  * implement `ExpandableExtension`
    * move all expandable depending logic to the extension
* update sample app and MaterialDrawer to support the extension
  * still keep the methods as easy access within the FastAdapter --> may be revisited in the future
* remove the positionBasedStateManagement, it's just unnecessary code overhead, and hard to maintain
  * the identifierBasedStateManagement has many advantages and it's only overhead is that we have to run once over the whole list of items (in the worst case)
* fix issue with the SelectExtension not getting properly initialized
* simplify getSelectedItems and getSelections
* remove no longer needed util functions
mikepenz added 4 commits June 9, 2017 23:16
# Conflicts:
#	library-core/build.gradle
#	library-core/gradle.properties
#	library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
* update gradle build tools
@mikepenz
Copy link
Owner Author

mikepenz commented Jul 15, 2017

Remaining TODO's

  • Id's negative
  • IdDistributor false by default
  • delete setModel
  • change filter behaviour

mikepenz and others added 27 commits August 10, 2017 08:27
* also update core version snapshot
* The default implementation will use an shared cache for all fast adapter instances
* Its now possible to implement an own caching solution for the type instances
* update gradle build tools
… do the heavy work (the item can be even more dumb)

* if FastAdapter.ViewHolder is used, the callbacks on the item are not used
* update README for v3
@mikepenz mikepenz force-pushed the feature/v3_new branch 2 times, most recently from af23c32 to bfb748d Compare October 29, 2017 14:22
@mikepenz mikepenz merged commit b77477e into develop Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants