How to handle adapters with multiple view types?

#10 · closed · 1 comments

View on GitHub ↗

amanzan

I have an adapter with multiple view types, and I only want to apply parallax to one type, which is a normal image (the others are header and footer, with no images). The problem is I get a crash saying that my HeaderViewHolder cannot be cast to ParallaxViewHolder. I tried extending from HeaderViewHolder but it also crashes because I don't have any ParallaxImageView. How can I handle this situation?

Comments

MihaelIsaev

Just create hidden parallax image views in your header and footer, that's it.