Skip to content

Instantly share code, notes, and snippets.

@thesiamak
Created August 19, 2021 09:01
Show Gist options
  • Save thesiamak/0ffbcc8a04a5beffe6837ded7a40c195 to your computer and use it in GitHub Desktop.
Save thesiamak/0ffbcc8a04a5beffe6837ded7a40c195 to your computer and use it in GitHub Desktop.
class MyFragment:Fragment(){
val displayTimer = DisplayTimer(requireContext())
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// assign the observability to timer view.
viewLifecycleOwner.lifecycle.addObserver(displayTimer)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment