Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customised header text #3

Open
cosmicudemy opened this issue Jun 25, 2020 · 1 comment
Open

Customised header text #3

cosmicudemy opened this issue Jun 25, 2020 · 1 comment

Comments

@cosmicudemy
Copy link

cosmicudemy commented Jun 25, 2020

I am only using smart adapter but want to get Different Header on both Sections...
So I am Passing header text in the constructor and using onCreateHeaderViewHolder to initialize the header text but in my case only first text is getting used in both the sections....

I am adding section as below:-

    SmartAdapter postAdapter=new SmartAdapter(color, sectionDataManager, true, false,data,"Posts");
                    sectionDataManager.addSection(postAdapter, null, postAdapter.type);


                    SmartAdapter userAdapter=new SmartAdapter(color, sectionDataManager, true, false,Udata,"Users");
                     sectionDataManager.addSection(userAdapter, null, userAdapter.type);

Pls let me know how can I achieve this....

@lizapopova
Copy link
Collaborator

Hi @cosmicudemy,
Sorry for the late reply.
It seems to me that your problem is that headers for sections are reused, but are not updated correctly.
Make sure you override onBindHeaderViewHolder and apply appropriate string value to your TextView.
Another solution might be passing different header types when adding your sections via SectionDataManager#addSection method (example SmartAdapter implementation defines the same type variable for all instances).
If this doesn't solve your problem, please give me more details (e.g. full code of your `SmartAdapter' implementation).
Anyway, let me know if my answer was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants