github mikepenz/FastAdapter v4.0.0

latest releases: v5.7.0, v5.6.0, v5.5.1...
5 years ago

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 the FastAdapter 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 the FastItemAdapter, provide the ItemAdapter or ModelAdapter instead.
  • The IItem interface now only requires the ViewHolder type.
  • The IExpandable interface was changed and now extends IParentItem and ISubItem.
  • The ISubItem interface now only requires the ViewHolder type.
  • The IParentItem interface only requires the ViewHolder 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 and scroll 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.

Don't miss a new FastAdapter release

NewReleases is sending notifications on new releases.