This file contains 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 SampleListActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
setContent { | |
val items = arrayOf("item 1", "item 2",...) | |
LazyColumn { | |
// Add 10 items |
This file contains 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 SampleListActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
setContentView(R.layout.list_activity) | |
val customAdapter = CustomAdapter( | |
arrayOf("item 1", "item2",...) | |
) | |
This file contains 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
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/recycler_view" | |
android:layout_width="match_parent" |