I'm working with MergeAdapter (A.K.A ConcatAdapter)
https://medium.com/androiddevelopers/merge-adapters-sequentially-with-mergeadapter-294d2942127a
But what I need to do is that the first Adapter should show a gridlayout and the second one a linearlayout, so , if I do it like this
val headerAdapter = HeaderAdapter(requireContext(), Header("TestHeader"))
val dividerViewAdapter = DividerViewAdapter(requireContext())
val animalAdapter = DividerViewAdapter(requireContext(),DataSource.animalList) // -> this should be shown as a GridLayout
val mergeAdapter = MergeAdapter(headerAdapter,dividerViewAdapter,animalAdapter)
test_rv.layoutManager = LinearLayoutManager(requireContext())
test_rv.adapter = mergeAdapter
Now this code works fine, but since it has a linearlayoutmanager all the content will be shown as a LinearLayout in which my animalAdapter will not display as I want.
Is there anyway to setup different layoutmanagers for the different adapters to show the data in the way I want ?