Skip to content

Instantly share code, notes, and snippets.

@muzafakar
Created October 14, 2019 14:49
Show Gist options
  • Save muzafakar/fad6a7a6b8484479772378810cb76054 to your computer and use it in GitHub Desktop.
Save muzafakar/fad6a7a6b8484479772378810cb76054 to your computer and use it in GitHub Desktop.
class AdpOnBoarding(fm: FragmentManager, behavior: Int) : FragmentPagerAdapter(fm, behavior) {
private val fragments = mutableListOf<Fragment>()
fun addItem(fragment: Fragment) {
fragments.add(fragment)
notifyDataSetChanged()
}
override fun getItem(position: Int): Fragment = fragments[position]
override fun getCount(): Int = fragments.size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment