WARNING
- This release is fully migrated to kotlin
Changes
- Full migration to kotlin
- Split apart into smaller library modules
- Expandable in different package
ModelAdapter
is 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
IItem
interface now requires a type specification. E.g.IItem<RecyclerView.ViewHolder>
- The
SelectExtension
is no longer default enabled and wrapped in theFastAdapter
use 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)
, ... FastAdapterDiffUtil
no longer directly takes theFastItemAdapter
, provide theItemAdapter
orModelAdapter
instead.- The
IItem
interface now only requires theViewHolder
type. - The
IExpandable
interface was changed and now extendsIParentItem
andISubItem
. - The
ISubItem
interface now only requires theViewHolder
type. - The
IParentItem
interface only requires theViewHolder
type. IIdentifyable
interface 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
,drag
andscroll
extension.
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.