Recycler View With Sticky Headers & Multiple Layout (Kotlin , View Binding)

Here we will look on how to inflate multiple views in a recycler view and put a sticky header
For complete code : GitHub

Adapter code for recycler view

Activity Code where recycler view is intialized
In OnScrollChanged method inside RvStickyScroll code for header is written

Whenever on top of our recycler view if any header layout is completely visible then we hide header textView of activity ,
but if header layout if partially visible or there is no header layout on top then we show header textview of acitivity and set text to header value

Model class will be like 

You can also send a any type list to adapter and inflate any number of layouts

Thanks, Hope it helps you!

Application Developer (Android, Xamarin)