finds.dev

hongyangAndroid/baseAdapter

Android 万能的Adapter for ListView,RecyclerView,GridView等,支持多种Item类型的情况。

View on GitHub

★ 4,708JavaApache-2.0updated Oct 2021

// the take

A boilerplate-reduction library for Android list adapters, targeting ListView, RecyclerView, and GridView. It wraps the ViewHolder pattern into a fluent helper and adds decorator-style wrappers for headers, footers, load-more, and empty views. Aimed at Android developers who were tired of writing the same adapter scaffolding over and over in the pre-Jetpack era.

The delegate pattern for multi-type items is genuinely well-structured — each item type gets its own class with a clear isForViewType/convert contract, which keeps things testable and avoids switch-statement sprawl. The decorator chain (EmptyWrapper(LoadMoreWrapper(HeaderAndFooterWrapper(adapter)))) is a clean composition model that doesn't force you into a single monolithic adapter. ViewHolder fluent API (setText, setImageResource, setOnClickListener by ID) cuts out a lot of findViewById noise. The library ships two separate artifacts for ListView and RecyclerView rather than one messy abstraction covering both.

Last commit was 2021, and the Maven coordinates reference Gradle's old `compile` dependency syntax — this thing predates Jetpack by a wide margin and hasn't kept up. If you're on a modern Android project you should be using RecyclerView's ConcatAdapter or ListAdapter with DiffUtil, neither of which this library supports. No DiffUtil integration means every update calls notifyDataSetChanged(), which kills animations and hammers the UI thread on large lists. The README is entirely in Chinese, which will slow down non-Chinese-speaking contributors; the code itself has no English comments either.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
4,708
Forks
1,193
Language
Java
License
Apache-2.0
Last commit
13 Oct 2021

// nearby

If baseAdapter isn't quite it.

All repos →