Skip to content

Instantly share code, notes, and snippets.

@gastsail
Created June 27, 2020 14:15
Show Gist options
  • Save gastsail/85d8c7bcd976a5408ab7a7ec298abdcf to your computer and use it in GitHub Desktop.
Save gastsail/85d8c7bcd976a5408ab7a7ec298abdcf to your computer and use it in GitHub Desktop.
val animalAdapter = AnimalAdapter(this)
animalAdapter.setAnimals(mutableListOf(Animal("Dog","DogImgUrl"),Animal("Cat","CatImgUrl"),Animal("Hamster","HamsterImgUrl"),Animal("Shark","SharkImgUrl"))
val breedAdapter = DogBreedAdapter(this)
breedAdapter.setBreeds(mutableListOf(Breed("Bulldog"),Breed("Beagle"),Breed("Bulldog"),Breed("Golden retriever"))
//Lets create now the ConcatAdapter with these adapters ready
val concatAdapter = ConcatAdapter(animalAdapter,breedAdapter)
animal_rv.layoutManager = LinearLayoutManager(requireContext())
animal_rv.adapter = concatAdapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment