Created
June 9, 2020 08:28
-
-
Save sandipsavaliya112/4ac587ce599a712473d22e516fff3897 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 items = ArrayList<BaseModel>() | |
items.add(Trip().apply { from = "NewYork"; to = "Chicago"}) | |
items.add(Trip().apply { from = "London"; to = "Pennsylvania"}) | |
items.add(Progress()) | |
binding.recyclerView.adapter = Adapter(items){ holder, model -> | |
when(holder.binding){ | |
is ItemTripBinding -> holder.binding.item = model as Trip | |
is ProgressBinding -> holder.binding.item = model as Progress | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment