A RecyclerView solution, support addHeaderView、addFooterView
A RecyclerView solution, support addHeaderView、addFooterView
Legacy RecyclerView header/footer support and AndroidX migration examples.
简体中文 · Legacy examples · Development
This project originally made it easier to add headers, footers and loading-state examples to RecyclerView. Today, it preserves that implementation as a buildable migration reference alongside an AndroidX example.
For new projects, use AndroidX ConcatAdapter for headers and footers. Add Paging when you need managed pagination. Existing integrations can migrate incrementally; this branch is not a drop-in update for the old Android Support library.
samplePlus; its page uses no API from this library.
Maintaining an existing integration
Review compatibility and maintenance and the legacy usage notes.
Looking for the original examples
See legacy usage and screenshots.
Contributing or working with an AI agent
Read CONTRIBUTING.md, architecture and AGENTS.md.
ConcatAdapter(headerAdapter, dataAdapter, footerAdapter)
Data-row click positions
getBindingAdapterPosition(), checking NO_POSITION
Incremental list updates
ListAdapter / DiffUtil
Managed pagination and retry UI
Paging + PagingDataAdapter + LoadStateAdapter
Full-width grid / staggered-grid decorations
Explicit span lookup / full-span layout parameters
ConcatAdapter handles adapter composition, notification offsets and view-type isolation; it does not choose layout spans. Paging migration also requires moving data requests and pagination state, not just replacing a scroll listener. See the official ConcatAdapter reference and Paging loading-state guide.
Use JDK 17 or 21, Android SDK 36, and Build Tools 35.0.0. Set ANDROID_HOME or configure an untracked local.properties; see setup details.
sdkmanager "platforms;android-36" "build-tools;35.0.0" "platform-tools"
./gradlew testDebugUnitTest assembleDebug lintDebug --console=plain
Use gradlew.bat on Windows. First builds download dependencies. Tests run on the host without an emulator. The build pins Gradle 8.13, AGP 8.11.1, RecyclerView 1.4.0 and AppCompat 1.7.1; all modules require Android API 21+.
library
Legacy wrapper, position/span helpers and scroll callbacks; retained for migration and regression coverage.
sample
Minimal legacy header/footer example.
samplePlus
AndroidX grid example first, followed by legacy linear/grid/staggered paging demos.
Open the root project in Android Studio and run samplePlus. In ConcatAdapter (AndroidX), headers and footers span both columns; tapping an item reports its position within the data adapter. The two demo apps have different application IDs and can be installed together.
The modern page is ConcatExampleActivity.java. samplePlus still depends on library for its other demos; copying the modern page does not require the legacy wrapper. This repository does not include a complete Paging or Compose app.
android.support types to AndroidX and raises the minimum SDK from 14 to 21 for library and sample. Legacy Support consumers must update their imports and rebuild.No open issues yet, or sync has not completed.