Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created March 16, 2020 03:42
Show Gist options
  • Save cdmunoz/4b158641ac02e0b2bdde034657337ab9 to your computer and use it in GitHub Desktop.
Save cdmunoz/4b158641ac02e0b2bdde034657337ab9 to your computer and use it in GitHub Desktop.
bind method with navigation
class PhotosViewHolder(rowBinding: RowPhotoHomeBinding) :
RecyclerView.ViewHolder(rowBinding.root) {
private val binding = rowBinding
fun bind(str: String) {
binding.camera = str
val bundle = bundleOf("PHOTO_NAME" to str)
binding.root.setOnClickListener { view ->
Navigation.findNavController(view).navigate(R.id.action_home_to_details, bundle)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment