Getting section headers to work with SuperSLiM and RecyclerView
Asked Answered
P

0

7

I'm trying to implement section headers in my RecyclerGrid in Android. I came across SuperSLiM which basically has all the functions I need.

Now the problem is, in my opinion, it's badly documented how to really implement this so that it's working. I was reading through the given example, but it's full of functions where I only partly understand what they do.

My own implementation of SuperSliM worked so far as it was showing the headers and the custom views that I use as items, but it was crazily messed up while scrolling. (items where shown multiple times, headers went on items and so forth)

My simple question is, can someone provide me a simple and understandable example of how to implement the SuperSLiM manager (as Grid Manager) into my RecyclerView? Also if there is a better alternative I would appreciate any help.

If it's not clear to you on how my layout should look like I have an example image below:

enter image description here

Important to mention is, that my items are not just simple TextViews but comparable to a CardView.

Thanks a lot in advance!

Phloem answered 1/4, 2015 at 17:29 Comment(8)
Better use the tag "superslim" so it can easily be discovered by the author and other users. I'm currently in the same situation as you and I'm really confusedSelfconsistent
Sadly I have not the reputation to create the superSLiM tag. Still I can help you since I fixed my issue without StackOverflow which seems to not know answers to more advanced questions... Just post it here as a comment.Phloem
Just to give you a basic idea on how SuperSLIM works: SuperSLiM is a LayoutManager that means that you always have to create your grid view as you would do with the default one. But instead of using the standard LayoutManager you use SuperSLiM. Then once you instantiated it you will have to take care of some stuff inside you View Adapter. [link]github.com/TonicArtos/SuperSLiM/blob/early_release_4/example/… shows pretty well what you have to take care of. I'll provide some code later. If there's the need to.Phloem
BTW: Better write an email directly to tonic Artoz and don't post an issue. Tonic is already aware of that his examples are a bit confusing and he will help you as he helped me. (The answer to my question I posted here was that I simply didn't set the ` sectionFirstPosition` well and that completely messed up the whole layout..)Phloem
Sorry, I wasn't aware of the tagging issue until today. I guess I'll have to get my rep up and make one myself.Commutator
I started to develop a simple app to demonstrate the SuperSlim usage and currently has just one example, but I intend to develop several others. see here SuperSlimDemoSeriatim
@anderson_acs Very well - be sure to always comment what you do in which step. Otherwise even simple applications get hard to understand ;) @_Tonic Artos Yeah it's a pretty bad system here, but well stackoverflow never was capable of answering questions beyond "how do I convert string to int" ^^Phloem
@binloan, thanks! I will improve the example!Seriatim

© 2022 - 2024 — McMap. All rights reserved.