kotlinmaterialcardview

How to set multiple CardViews using when condition in a single RecyclerView in a fragment?


I want to know whether it is possible to get position-wise card view which are in view pager fragments in a single recycler view?


Solution

  • We can use the when condition for different positions say, when(position){ "1"-> ... "2" -> ... } likewise, this can be done. Using a single RV instead of multiple RV we can set the multiple adapters.