Git Product home page Git Product logo

canopas / compose-recyclerview Goto Github PK

View Code? Open in Web Editor NEW
135.0 2.0 6.0 532 KB

Seamlessly integrate Jetpack Compose composables in RecyclerView with ComposeRecyclerView🔥. This library enhances performance⚡, tackles LazyList issues🔨, and offers built-in drag-and-drop👨🏽‍💻 support for dynamic UIs.

License: Apache License 2.0

Kotlin 100.00%
andriod android-library drag-and-drop jetpack-compose jetpack-compose-tutorial kotlin kotlin-library lazylist recyclerview recyclerview-adapter

compose-recyclerview's People

Contributors

cp-megh-l avatar miniemerald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

compose-recyclerview's Issues

Crash when update list with smaller size

If you try to update list that contains less elements than previous state - it cause crash. Because totalCount not updated
Example:

  1. You have list with 10 elements
  2. Not necessary. Add new element into list. Everything ok. List size = 11
  3. Remove one element from list. List size = 10. App crash

Looks like we need to change setter of totalCount and add some logic for notifyItemRemoved()
Or another possible solution is to add diff_utils mechanic

Drag-and-drop does not work out of the box

First of all, I want to thank you for this nice wrapper around RecyclerView 👏🏻

Secondly, as a new user, the README/documentation of this repository was not very clear in informing me that for drag-and-drop to work, I need to pass in an object of ComposeRecyclerViewAdapter.ItemTypeBuilder. I had to figure it out by trial and error.

Therefore, to make it easier for future users to get started easily, I'd request you to either mention the fact above, or better yet, instead of using null as the default value for the itemTypeBuilder param in ComposeRecyclerView, give it a default non-null value that allows drag-and-drop by default.

For example:

private val DefaultItemTypeBuilder = object : ComposeRecyclerViewAdapter.ItemTypeBuilder {
    override fun getItemType(position: Int): Int = 0
}

// Rest of the code
// Mention that in order to remove drag-and-drop, users would need to pass `null` into this param
itemTypeBuilder: ComposeRecyclerViewAdapter.ItemTypeBuilder = DefaultItemTypeBuilder,
// Rest of the code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.