Created
June 27, 2020 18:35
-
-
Save gastsail/95a376e704a74ff919726a46cf58c7db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(GridConcatAdapter(this,animalAdapter,4),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