kibotu / Recyclerviewpresenter
Licence: apache-2.0
RecyclerView Adapter Library with different models and different layouts as convenient as possible.
Stars: ✭ 86
Programming Languages
kotlin
9241 projects
Projects that are alternatives of or similar to Recyclerviewpresenter
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (+44.19%)
Mutual labels: adapter, recyclerview, mvvm
Adapter
A quick adapter library for RecyclerView, GridView, ListView, ViewPager, Spinner
Stars: ✭ 376 (+337.21%)
Mutual labels: adapter, recyclerview
Superadapter
[Deprecated]. 🚀 Adapter(BaseAdapter, RecyclerView.Adapter) wrapper for Android. 一个Adapter同时适用RecyclerView、ListView、GridView等。
Stars: ✭ 638 (+641.86%)
Mutual labels: adapter, recyclerview
Boardview
A draggable boardview for java android (Kanban style)
Stars: ✭ 309 (+259.3%)
Mutual labels: adapter, recyclerview
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+3983.72%)
Mutual labels: adapter, recyclerview
Multiitem
一个优雅的实现多类型的RecyclerView类库 支持DataBinding Form表单录入 跨多个RecyclerView拖动
Stars: ✭ 381 (+343.02%)
Mutual labels: adapter, recyclerview
Launcher-OnePlus
Customizable and Open Source Launcher for Android
Stars: ✭ 73 (-15.12%)
Mutual labels: recyclerview, mvvm
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-79.07%)
Mutual labels: mvvm, recyclerview
Slimadapter
A slim & clean & typeable Adapter without# VIEWHOLDER
Stars: ✭ 939 (+991.86%)
Mutual labels: adapter, recyclerview
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-82.56%)
Mutual labels: adapter, recyclerview
Graphql To Mongodb
Allows for generic run-time generation of filter types for existing graphql types and parsing client requests to mongodb find queries
Stars: ✭ 261 (+203.49%)
Mutual labels: update, sort
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+3304.65%)
Mutual labels: adapter, recyclerview
Flexibleadapter
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Stars: ✭ 3,482 (+3948.84%)
Mutual labels: adapter, recyclerview
adapster
Android library designed to enrich and make your RecyclerView adapters more SOLID
Stars: ✭ 17 (-80.23%)
Mutual labels: adapter, recyclerview
Flagchatadapter
FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction.
Stars: ✭ 39 (-54.65%)
Mutual labels: adapter, recyclerview
AdapterLayout
ViewGroup backed by RecyclerView.Adapter = magic
Stars: ✭ 58 (-32.56%)
Mutual labels: adapter, recyclerview
GhostAdapter
No description or website provided.
Stars: ✭ 15 (-82.56%)
Mutual labels: adapter, recyclerview
Multityperecyclerviewadapter
一个专注于RecyclerView优雅刷新(接管资源和数据源)、高灵活、低耦合、健壮性以及高效性的MVP模式库,支持大多数Adapter
Stars: ✭ 763 (+787.21%)
Mutual labels: adapter, recyclerview
RecyclerView Presenter
Convenience library to handle different view types with different presenters in a single RecyclerView.
How to install
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation 'com.github.kibotu:RecyclerViewPresenter:-SNAPSHOT'
}
How to use
- Create a presenter, e.g. PhotoPresenter or LabelPresenter
class LabelPresenter : Presenter<String>(R.layout.label_presenter_item) {
private val View.label: TextView
get() = findViewById(R.id.label)
override fun bindViewHolder(viewHolder: RecyclerView.ViewHolder, item: PresenterViewModel<String>, payloads: MutableList<Any>?) = with(viewHolder.itemView) {
logv { "bindViewHolder ${viewHolder.adapterPosition} $item payload=$payloads" }
label.text = "${item.model}"
}
}
val adapter = PresenterAdapter()
list.adapter = adapter
adapter.registerPresenter(PhotoPresenter())
adapter.registerPresenter(LabelPresenter())
adapter.registerPresenter(NumberPresenter())
- Submit list of models with presenter matching layout to the adapter, e.g.:
val items = mutableListOf<PresenterViewModel<*>>()
for (i in 0..99) {
items.add(PresenterModel(createRandomImageUrl(), R.layout.photo_presenter_item))
items.add(PresenterModel(createRandomImageUrl(), R.layout.label_presenter_item))
items.add(PresenterModel(createRandomImageUrl(), R.layout.number_presenter_item))
}
adapter.submitList(items)
5.1 Add click listener to adapter
adapter.onItemClick { item, view, position ->
snack("$position. ${item.model}")
}
5.2 or pass to your RecyclerViewModel
val item = PresenterViewModel(createRandomImageUrl(), R.layout.photo_presenter_item) { item, view, position ->
snack("$position. $item")
})
Updating item
adapter.submitList(newItems)
Circular
adapter.isCircular = true
// Note: use adapter scroll methods for correct scroll position when using circular
adapter.smoothScrollToPosition(0)
adapter.scrollToPosition(0)
Notes
Let me know what you think: [email protected]
Contributions welcome!
License
Copyright 2021 Jan Rabe Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].