Open ShankyPatel opened 4 years ago
just researched and got to know the header item that is drawn over is not clickable. is there any function or method that i can use it to make the button inside drawn header can be clickable ?
Hi. Try to override onBindHeaderViewHolder() in your adapter and set a click listener on your header view there.
hi shuhart, i have already overridden onBindHeaderViewHolder() method but the listener only works when the the header item is clicked which is at 0th position in my list. I have set getHeaderPositionForItem() return position as 0 as i have header only at 0th position does it causing any issues ?
Setting in click listener onBindViewHolder won't work because the viewHolder is not added in the view hierarchy. Bitmap of the viewholder is drawn on recycler view canvas. Hence the touch event is delivered beneath the header.
Hi,
The item underneath my header item gets clicked. If i scroll the list and if there is an item under the header item then whatever the function underneath item has get clicked. How do i resolve it ?