Comments (5)
@davideas I've added collapsable sections, and while the (default) animation isn't great, the behavior is correct and reliable. I've also implemented onSaveInstanceState
and onRestoreInstanceState
to StickyHeaderLayoutManager
.
I don't know if this is helpful, but thought you may be interested.
from stickyheaders.
@davideas I've just implemented scrollToPosition and smoothScrollToPosition, and am working on a performance fix for huge datasets. I'll be pushing an update this week with those fixes, and you're free to use it in any way you wish. If there's any specific functionality you'd like me to implement, such as clicking on headers let me know.
from stickyheaders.
@ShamylZakariya, great!
Actually, I was able to resolve all the crashing issues, and now my Adapter is quite stable, but inclusion of your LayoutManager remains a long base task to do.
Indeed, the click on the sticky item is necessary otherwise the event is propagated to the view below.
When I will have more time I will focus on this inclusion.
It would be nice to have a differentiation of the 3 layout managers, Linear, Grid(extends linear) and Staggered.
Thanks!
from stickyheaders.
Hello @ShamylZakariya, I checked your latest changes, you are doing a good jobs, no dubts 👍
Animation isn't great because you are using notifyDataSetChanged()
!
Just keep in mind that now the custom Adapter you are making is not very usable, if not in the context of sticky header / sections only, and nothing else. Your Layout and Adapter are strictly related to each other's.
Now, you are on the point to do what I already did it, I mean: Click listeners, handling selection, keep selection on after expand / collapse, handling multiple items type, call notify on single item or a range of items (not notifyDataSetChanged()
..), auto-expand, multiple layouts, etc (the list is very long)...
Why?
In an App, any user cannot create selection mechanism and all those stuff every time for each Adapter from scratch, that's why I created FlexibleAdapter. The problem is that, there are a lot of libraries out there that make A-B-C things, and they are not compatible with others libraries that do C-D-E things, and you need all.
I hope you got the point :-)
from stickyheaders.
If you look at the implementation of SectioningAdapter::setSectionIsCollapsed
here https://github.com/ShamylZakariya/StickyHeaders/blob/master/stickyheaders/src/main/java/org/zakariya/stickyheaders/SectioningAdapter.java#L400 you'll see that I'm actually just reloading the section data, which in turn maps to notifyItemRangeChanged
, so no I'm not making the newb mistake of calling notifyDataSetChanged
. And when I complain about the animation, it's only that the default animation is simple, but the thing does animate, I just don't feel like diving in any deeper.
Also, regarding the tight coupling between StickyHeaderLayoutManager and SectioningAdapter, it's fine by me. SectioningAdapter works great with other LayoutManagers, such as LinearLayoutManager. The only coupling is that StickyHeaderLayoutManager requires SectioningAdapter because, frankly, the StickyHeaderLayoutManager needs to know the sectioning structure of your data. AN alternative would be for users to have to provide two adapters, one vanilla adapter, and a second one which attempts to provide sectioning information using the data in the first adapter - that would be unintuitive.
Anyway, I guess I don't have anything I can contribute to your project. Feel free to use any code if you want, but it looks like you're making a very large, very powerful framework, and I'm making a tiny lib for a very specific purpose.
from stickyheaders.
Related Issues (20)
- Class cast exception after upgrading to android x HOT 1
- Disabling item section collapsing on open HOT 2
- Publish version 0.7.9 to Maven HOT 4
- IndexOutOfBoundsException HOT 6
- How to set setStackFromEnd??
- Accessibility using StickyHeaders HOT 1
- App Crashing If the List size is 0. HOT 2
- Custom Scroll Behaviour
- wrap_content not working
- notifySectionItemChanged() crashes the app
- How to include grid layout with sticky headers ?
- This lib doesn't seem to support clipToPadding = false on RecyclerView
- Item size 0 , crash the app. HOT 1
- jcenter is deprecated. Move to mavencentral HOT 2
- how to get the current sticky section?
- StickyHeaderLayoutManager doesn't display scroll bars HOT 4
- Refactor AndroidX HOT 5
- StickyLayoutManager does not work in kotlin and recycler view appears empty HOT 1
- when user scroll the page, data changed in rows !
- Some problems when use this with smartRefreshLayout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stickyheaders.