Skip to content

Instantly share code, notes, and snippets.

@trevorhackman
Created May 21, 2022 16:54
Show Gist options
  • Save trevorhackman/473f9e05d9ff6a96e642d0f05c842e1b to your computer and use it in GitHub Desktop.
Save trevorhackman/473f9e05d9ff6a96e642d0f05c842e1b to your computer and use it in GitHub Desktop.
Android View Binding Without Boilerplate - Part 2 - 1
private var _binding: ProfileBinding? = null
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = ProfileBinding.inflate(inflater, container, false)
return binding.root
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment