Skip to content

Instantly share code, notes, and snippets.

@douglasiacovelli
Last active August 22, 2019 13:50
Show Gist options
  • Select an option

  • Save douglasiacovelli/cb86ffaa5c23852e1c144f81e751ee80 to your computer and use it in GitHub Desktop.

Select an option

Save douglasiacovelli/cb86ffaa5c23852e1c144f81e751ee80 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
private val viewPager by lazy { findViewById<ViewPager>(R.id.viewPager) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
//getSections somehow from API/local storage
val pagerAdapter = PagerAdapter(supportFragmentManager, sections)
viewPager.adapter = pagerAdapter
//...
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment