Skip to content

Instantly share code, notes, and snippets.

@tmaxxdd
Last active May 29, 2018 08:00
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 tmaxxdd/723a8249833b7185b2a4ba41abe64b01 to your computer and use it in GitHub Desktop.
Save tmaxxdd/723a8249833b7185b2a4ba41abe64b01 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
...
private lateinit var recyclerView: RecyclerView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
recyclerView = findViewById<RecyclerView>(R.id.main_rv).apply {
setHasFixedSize(true)
layoutManager = viewManager // recyclerView.layoutManager = viewManager
adapter = viewAdapter // recyclerView.adapter = viewAdapter
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment