Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Created September 22, 2020 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaozinfs/58dfff87b3486647996cfc0f693e2f8c to your computer and use it in GitHub Desktop.
Save jaozinfs/58dfff87b3486647996cfc0f693e2f8c to your computer and use it in GitHub Desktop.
Cria uma classe com callback para avisar quando trocar de pagina do ViewPager
inner class SlideTrailersCallback : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
startSlide()
}
}
pager.registerOnPageChangeCallback(SlideTrailersCallback())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment