adapter-kit icon indicating copy to clipboard operation
adapter-kit copied to clipboard

Override SimpleSectionAdapter getView

Open bbbenja opened this issue 10 years ago • 3 comments

Hello, in my project, I have to override SimpleSectionAdapter to change style of the section background. Is there a way to do this properly ?

In my case, I override the getView method, do the switch again, and set the background color on my view. To do this I have to create another mContext field and constant VIEW_TYPE_SECTION_HEADER because there are private.

Thx

bbbenja avatar Apr 16 '14 09:04 bbbenja

@bbbenja You can just supply a different layout for the section.

Please check the constructor, it allows you to specify a custom layout for this purpose.

SimpleSectionAdapter(Context context, BaseAdapter listAdapter, int sectionHeaderLayoutId, int sectionTitleTextViewId, Sectionizer<T> sectionizer)

Let me know if this is what you are looking for or do you want to make changes to the section header during runtime?

ragunathjawahar avatar Apr 24 '14 04:04 ragunathjawahar

Yeah it is during the runtime

bbbenja avatar Apr 24 '14 15:04 bbbenja

@bbbenja Nice suggestion, will implement a callback that will allow you to do that.

ragunathjawahar avatar Apr 28 '14 06:04 ragunathjawahar