Section headers are not visible
See original GitHub issueI’ve tried to implement sticky section headers using the first use case provided in the documentation at https://github.com/davideas/FlexibleAdapter/wiki/5.x-|-Headers-and-Sections. I’m adding only AppointmentItems to the list and calling updateDataSet(list). In the fragment I’m calling adapter.setDisplayHeadersAtStartUp(true).
As far sa I can tell, I think everything seems ok. However, headers are not showing up, only the items. Am I missing something?
class MyAdapter: FlexibleAdapter<AbstractFlexibleItem<FlexibleViewHolder>>(ArrayList())
{
inner class AppointmentItem(
private var sectionItem: SectionItem?,
var appointment: AppointmentViewModel) : AbstractFlexibleItem<AppointmentViewHolder>(),
ISectionable<AppointmentViewHolder, SectionItem>
{
override fun getHeader(): SectionItem?
{
return sectionItem
}
override fun setHeader(header: SectionItem?)
{
this.sectionItem = header
}
override fun equals(other: Any?): Boolean
{
return other is AppointmentItem && other === this
}
override fun hashCode(): Int
{
var result = sectionItem?.hashCode() ?: 0
result = 31 * result + appointment.hashCode()
return result
}
}
inner class SectionItem(
var startDate: Date?,
var endDate: Date?) :
AbstractExpandableHeaderItem<SectionViewHolder, AppointmentItem>()
{
override fun equals(other: Any?): Boolean
{
return other is SectionItem && other === this
}
override fun hashCode(): Int
{
var result = startDate?.hashCode() ?: 0
result = 31 * result + (endDate?.hashCode() ?: 0)
return result
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
UITableView Section Header not showing - Stack Overflow
Try this out for UITableView Section Header. Programatically create headerview func tableView(tableView: UITableView, viewForHeaderInSection ...
Read more >Section headers not visible in Card Form - Jotform
Hello! The reason for this behavior is that when there are multiple section headers one after the other, only one will show, as...
Read more >Collapsible Section Headers Not Displaying Correctly
My collapsible headers appear correctly on the desktop of a modern page. However the headers do not show up on the app on...
Read more >Section Header Names Didn't display in View Page?
I view the page " header Section names not display in the view page" but I am editing the page the header section...
Read more >r/todoist - Anybody has the same bug? Section headers not ...
Section headers not showing correctly in darkmode. Important: I'm part of the beta program. Does anybody else has the same problem?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bogdanzurac This is an example that supports displaying sticky titles, you can take a look. https://github.com/tcqq/FlexibleAdapterStickyHeaderExample
Then I suppose we should use the 2nd solution in our use case, which indeed works perfectly. Thanks for clearing things up!