Linkage-RecyclerView
即使不用饿了么订餐,也请务必收藏好该库!🔥 一行代码即可接入,二级联动订餐列表。
Linkage-RecyclerView is an Android library written in Java that adds a two-level linked list to mobile apps. The classic use case is a food delivery menu: one column shows category headers (like "Promotions" or "Best Sellers"), and the adjacent column shows the items in the selected category. Tapping a header scrolls the item list, and scrolling the item list updates the highlighted header automatically.
The library was created because the author could not find a suitable open-source component on GitHub and decided to build one from scratch. It is designed around an MVP architecture pattern, meaning the internal logic is hidden from the developer using the library. You configure what you want through a Config class rather than digging into the source code.
Getting started requires adding one line to your build.gradle file to pull the library from Maven Central, then placing the LinkageRecyclerView element in your layout file. Once you have your data ready, you call a single init method to display the linked list. The README notes that this single-line initialization covers the default setup, with a Wiki available for more advanced customization.
The project uses Android Jetpack components and the AndroidX library, along with Material Design 2 styling. ConstraintLayout is used for the built-in view layouts. The author explicitly avoids Dagger and other dependency injection tricks, aiming to keep the code readable and straightforward.
The README is written in Chinese. The library is licensed under the Apache 2.0 license.