Giter VIP home page Giter VIP logo

Comments (5)

ShamylZakariya avatar ShamylZakariya commented on August 17, 2024 1

@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.

ShamylZakariya avatar ShamylZakariya commented on August 17, 2024

@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.

davideas avatar davideas commented on August 17, 2024

@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.

davideas avatar davideas commented on August 17, 2024

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.

ShamylZakariya avatar ShamylZakariya commented on August 17, 2024

@davideas

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)

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.