Hey, looking at the multiple peaces of code here, I cannot wrap my head around how RecyclerView is choosing the right viewtype for that crime after they have been created. I understand how it’s choosing one when first creating one as it checks using getItemViewType.
For example, if I have every fifth crime as a serious crime which has a different view with a button in it, after 2-3 have been made, how is it able to use those again. If there was one view type then I would understand as it is using the same CrimeHolder going off screen and reusing it, but with the code for the challenge with 2 viewTypes, how is it able to deduce which viewType it has to use.
I see that getItemViewType seems to only be used in the onCreateViewHolder and not in the onBindViewHolder. How is onBindViewHolder calling the right bind method and not the abstract class’ bind method as seen there.
I’m really bad at explaining this, hope you understand even a bit of it. Thank you