Created
January 15, 2020 16:43
-
-
Save DjakaTechnology/f41ae07c6aaf0af1bb006623f0081424 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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