Skip to content

Instantly share code, notes, and snippets.

@DjakaTechnology
Created January 15, 2020 16:43
Show Gist options
  • Select an option

  • Save DjakaTechnology/f41ae07c6aaf0af1bb006623f0081424 to your computer and use it in GitHub Desktop.

Select an option

Save DjakaTechnology/f41ae07c6aaf0af1bb006623f0081424 to your computer and use it in GitHub Desktop.
class WithoutHolderActivity : AppCompatActivity() {
private val adapter = GenericAdapter(Utils.getFeedItems())
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_without_holder)
initAdapter()
initRV()
}
private fun initRV() {
rv_without_holder.adapter = adapter
rv_without_holder.layoutManager = LinearLayoutManager(this)
rv_without_holder.addItemDecoration(DividerItemDecoration(this, DividerItemDecoration.VERTICAL))
}
private fun initAdapter() {
adapter.apply {
addDelegate(FeedPostAdapterDelegate())
addDelegate(FeedStandardAdapterDelegate())
addDelegate(FeedStoryAdapterDelegate())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment