-
-
Save AlexPrestonSB/02cbc77173ec335d0ad7559e19b98954 to your computer and use it in GitHub Desktop.
Shows how to create a View Holder for handling Location Messages
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
override fun onCreateViewHolder( | |
parent: ViewGroup, | |
viewType: Int | |
): RecyclerView.ViewHolder { | |
val layoutInflater = LayoutInflater.from(parent.context) | |
when (viewType) { | |
AppConstants.VIEW_TYPE_LOCATION_ME -> { | |
return MyLocationHolder(layoutInflater.inflate(R.layout.item_gchat_map_me, parent, false)) | |
} | |
AppConstants.VIEW_TYPE_LOCATION_OTHER -> { | |
return OtherLocationHolder(layoutInflater.inflate(R.layout.item_gchat_map_other, parent, false)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment