dev-labs-bg / fast-list Goto Github PK
View Code? Open in Web Editor NEWCreate fast, dynamic recycler views. No adapter, no view holders
License: MIT License
Create fast, dynamic recycler views. No adapter, no view holders
License: MIT License
Just wanted to know if you would like to see a pull request with DiffUtil integration?
I think it can be done with observable from kotlin std library.
https://developer.android.com/reference/android/support/v7/util/DiffUtil
recyclerView.bind(list, R.layout.recycler_view_item) { item: FragmentItem ->
name.text = item.name
path.text = item.path
}
.layoutManager(LinearLayoutManager(this))
Activity crashed with log "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/list/rados/fast_list/FastListViewHolder;"
used in a Android module library with release 1.2 .
Why Library Compatibility Minimum Android SDK: API level 19?
Will be great get Android SDK: API level 16 Compatibility, if it possible
Cheers!
As a user it would be very helpful and a lot more intuitive to be able to bind items based on their class type, instead of an special Item
class with type.
First: great lib! I'm using it and it's really practical
Second: Would be great to add support for horizontal recyclerviews
I need to use the adapter's position in my project. How do I get it?
As a user, it would be helpful to be able to pass in a custom *LayoutManager
to the bind function.
In the DiffUtil code
As suggested by a teammate the areItemsTheSame and the areContentsTheSame should probably be reversed, since the compare closure seems more in line with comparing the contents. So it will look like this instead
`
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
return items[oldItemPosition] == newList[newItemPosition]
}
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
return compare(items[oldItemPosition], newList[newItemPosition])
}`
Or alternatively for more flexibility, you can change the lambda to have an additional param
compare: (T, T, Boolean)
where the Boolean lets the method know if this is the contentsTheSame check or not
Final comment, could you be making unnecessary copies of the new list
items = newList.toMutableList()
I am not sure if this is needed at all where you can just do
items = newList
Or if if has to be mutable
if (newList is MutableList) items = newList else items = newList.toMutableList()
I can send all these changes as a pull request if you like
This code should check to see if a manager is already set and if it is it should not change it.
Hey, your library looks nice, thanks for sharing.
But wanna got more anothers useful features with your library, such as:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.