Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Baserecyclerviewadapterhelper | 23,551 | 17 days ago | 9 | August 31, 2022 | 555 | mit | Kotlin | |||
BRVAH:Powerful and flexible RecyclerAdapter | ||||||||||
Binding Collection Adapter | 1,713 | 43 | 3 | 2 years ago | 15 | March 08, 2020 | 31 | apache-2.0 | Java | |
Easy way to bind collections to listviews and recyclerviews with the new Android Data Binding framework | ||||||||||
Lastadapter | 756 | 5 years ago | 12 | apache-2.0 | Kotlin | |||||
Don't write a RecyclerView adapter again. Not even a ViewHolder! | ||||||||||
All Base Adapter | 528 | 6 years ago | 5 | apache-2.0 | Java | |||||
Adapter terminator, including DataBinding, any ViewGroup, list(Rv, Lv ). Write Adapter, it is enough .Adapter终结者,包含DataBinding,任意ViewGroup,Rv、Lv列表。写Adapter,有它就够了 | ||||||||||
Mvvm Juejin | 405 | 4 years ago | 8 | mit | Java | |||||
高仿"掘金Android App": databinding + kotlin + rx 的优雅实践。(持续打磨中~) | ||||||||||
Multiitem | 349 | 5 years ago | 8 | apache-2.0 | Java | |||||
一个优雅的实现多类型的RecyclerView类库 支持DataBinding Form表单录入 跨多个RecyclerView拖动 | ||||||||||
Items | 258 | 4 years ago | apache-2.0 | Kotlin | ||||||
Generate data-view-binding adapters of android recycler view. | ||||||||||
Rxrecycleradapter | 194 | 4 years ago | 4 | Kotlin | ||||||
Rx based RecyclerView Adapter. | ||||||||||
Kotlin Adapter | 119 | 5 years ago | 1 | Kotlin | ||||||
🔥 RecyclerView,AbsListView适配器, 支持多种视图样式, 支持吸顶、侧滑删除、拖拽效果 | ||||||||||
Multi Type Adapter | 99 | 4 years ago | 1 | Java | ||||||
Super simple and easy to use common multi-type-adapter by android data-binding |
An Easy to use adapter for android
GenericAdapter : Adapter for simple usage
GenericFilterAdapter : Adapter with list filtering capability
Please find detail medium post here, Android Generic Adapter
This library is available in jitPack which is the default Maven repository used in Android Studio.
Step 1. Add it in your root build.gradle at the end of repositories
allprojects
{
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency in your apps module build.gradle
dependencies {
implementation 'com.github.manojbhadane:GenericAdapter:v1.4'
}
dataBinding {
enabled true
}
mDataBinding.recylerview.setAdapter(new GenericAdapter<PeopleModel, ListitemMainBinding>(this, arrayList) {
@Override
public int getLayoutResId() {
return R.layout.listitem_main;
}
@Override
public void onBindData(PeopleModel model, int position, ListitemMainBinding dataBinding) {
dataBinding.txtName.setText(model.getName());
dataBinding.txtAddress.setText(model.getAddress());
}
@Override
public void onItemClick(PeopleModel model, int position) {
}
});
var adapter = object : GenericAdapter<PeopleModel, ListitemMainBinding>(this, arrayList) {
override fun getLayoutResId(): Int {
return R.layout.listitem_main
}
override fun onBindData(model: PeopleModel?, position: Int, dataBinding: ListitemMainBinding?) {
dataBinding!!.txtName.text = model.getName()
dataBinding!!.txtAddress.text = model.getAddress()
}
override fun onItemClick(model: PeopleModel?, position: Int) {
}
}
dataBinding.recyclerview.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
dataBinding.recyclerview.adapter = adapter
Added list filtering capability to genericAdapter by extending GenericFilterAdapter class
Sample code of adapter with filter
mDataBinding.recylerview.setAdapter(new GenericFilterAdapter<PeopleModel, ListitemMainBinding>(this, arrayList) {
@Override
public int getLayoutResId() {
return R.layout.listitem_main;
}
@Override
public void onBindData(PeopleModel model, int position, ListitemMainBinding dataBinding) {
dataBinding.txtName.setText(model.getName());
dataBinding.txtAddress.setText(model.getAddress());
}
@Override
public void onItemClick(PeopleModel model, int position) {
}
@Override
public View getSearchField() {
return mDataBinding.edtSearch;
}
@Override
public ArrayList<PeopleModel> performFilter(String searchText, ArrayList<PeopleModel> originalList) {
ArrayList<PeopleModel> filteredList = new ArrayList<>();
for (PeopleModel row : originalList) {
if (row.getName().toLowerCase().contains(searchText.toLowerCase())
|| row.getName().contains(searchText)
|| row.getAddress().toLowerCase().contains(searchText.toLowerCase())) {
filteredList.add(row);
}
}
return filteredList;
}
});
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.
Android & Backend Developer.
MIT License
Copyright (c) 2020 Manoj Bhadane
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.