v4.0.0
WARNING
- This release is fully migrated to kotlin
Changes
- Full migration to kotlin
- Split apart into smaller library modules
- Expandable in different package
ModelAdapteris the base- Adjustments to interfaces and generic specifications to improve Kotlin usage
- Kotlin function types instead of interfaces for various cases
- Extension functions to simplify common usages
- TypeAlias for generic adapter types
- ...
Depencencies
The following major dependency versions are required:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.x.y"
implementation "androidx.appcompat:appcompat:1.x.y"
implementation "androidx.recyclerview:recyclerview:1.x.y"Migration
v4 is a huge release changing most of the codebase to Kotlin. This comes with many refactors, and as a result of that with many breaking API changes.
We put a lot of focus on type safety with this release, as such this release is a lot more strict and tries to prevent as many potential bad type mixups as possible.
- As a result of the Kotlin migration the static methods can now be accessed via
FastAdapter.Companion. E.g.:FastAdapter.Companion.with(...) - The
IIteminterface now requires a type specification. E.g.IItem<RecyclerView.ViewHolder> - The
SelectExtensionis no longer default enabled and wrapped in theFastAdapteruse its API standalone. E.g.:selectExtension.setSelectable(true), ... - Extensions can be retrieved via
getOrCreateExtension.SelectExtension<?> selectExtension = (SelectExtension<?>) mFastAdapter.getOrCreateExtension(SelectExtension.class) - Most API methods which were possible to be chained in the previous releases are now standard properties. So use
set/get. E.g.:sampleItem.setSelectable(false),sampleItem.setIdentifier(1), ... FastAdapterDiffUtilno longer directly takes theFastItemAdapter, provide theItemAdapterorModelAdapterinstead.- The
IIteminterface now only requires theViewHoldertype. - The
IExpandableinterface was changed and now extendsIParentItemandISubItem. - The
ISubIteminterface now only requires theViewHoldertype. - The
IParentIteminterface only requires theViewHoldertype. IIdentifyableinterface does not require any type anymore.
The v4 release brings a new more modular setup. Allowing to be a lot more precise on what to take from the FastAdapter.
Due to the new modules some packages of various classes might have changes. Check out here on GitHub for the new location of classes.
The new modules are:
- com.mikepenz:fastadapter-extensions-diff // diff util helpers
- com.mikepenz:fastadapter-extensions-drag // drag support
- com.mikepenz:fastadapter-extensions-scroll // scroll helpers
- com.mikepenz:fastadapter-extensions-swipe // swipe support
- com.mikepenz:fastadapter-extensions-ui // pre-defined ui components
- com.mikepenz:fastadapter-extensions-utils // needs the
expandable,dragandscrollextension.
If you have any issues during the migration, or any questions come up please open a github issue so we can improve the migration guide or the documentation.