You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
The issue reproduces periodically without any rules.
onCreateHeaderViewHolder and onBindHeaderViewHolder gets called, but headers are not visible
My code looks like
override fun getHeaderId(position: Int): Long {
return clients[position].companyName.toUpperCase().get(0).toLong()
}
override fun onCreateHeaderViewHolder(parent: ViewGroup): HeaderHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_client_list_header, parent, false)
return HeaderHolder(view)
}
override fun onBindHeaderViewHolder(holder: HeaderHolder, position: Int) {
val letter = clients[position].companyName.get(0).toUpperCase().toString()
holder.bind(letter)
}
It's a bit late but I was getting all sorts of weird behavior when the my recyclerview was set to android:layout_height="wrap_content". All the issues went away when I swapped to android:layout_height="match_parent". I had my recyclerview as a child in a relative layout.
My issue was that that onCreateHeaderViewHolder and onBindHeaderViewHolder were being called but the view wasn't showing. Just an empty view, of the correct size, where it should have been. Strangely the last several stickyHeaders would show up.
@graisVictory did you figure this out? I'm getting the same behavior: The callbacks are called but only the last header is correct. The other ones are blank and much too tall. I don't think it's related to @maroney-tm's solution because my layout_weight="1", meaning that the height shouldn't depend on content.
The issue reproduces periodically without any rules.
onCreateHeaderViewHolder and onBindHeaderViewHolder gets called, but headers are not visible
My code looks like
and xml:
But no matter what font or any other style (even without any style) I'm using - result is the same.
Note that I'm using this recycle view https://github.com/myinnos/AlphabetIndex-Fast-Scroll-RecyclerView
Help me please :(
The text was updated successfully, but these errors were encountered: