finds.dev← search

// the find

hongyangAndroid/baseAdapter

★ 4,708 · Java · Apache-2.0 · updated Oct 2021

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

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →