Klaus
09/25/2020, 10:05 AMalex_vinz
09/25/2020, 10:10 AMalex_vinz
09/25/2020, 10:10 AMJoost Klitsie
09/25/2020, 10:17 AMRecycler
view because even if you add 1000 items to it, it will not render 1000 items but only the visible ones. This is to make things a lot more performance friendly.
So knowing that RecyclerView is basically a ViewGroup (Just like a LinearLayout/RelativeLayout/ConstraintLayout) that will tell you that once you get its children, it will return child views. Meaning, the one it actually renders, as it is not rendering and adding 1000 views if only 5 are visible.
Inside you have an adapter to feed the data and a layout manager to position/load the views.
So in that case, Recyclerview has a helper function:
parent.getChildAdapterPosition(view) // parent is the recyclerview
With this position you can check for the item typeJoost Klitsie
09/25/2020, 10:18 AMKlaus
09/25/2020, 10:40 AM