View): RecyclerView.ViewHolder(view){} override fun getItemCount(): Int = data.size override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { // ... return ViewHolder(view) } override fun onBindViewHolder(holder: ViewHolder, position: Int) } ShoppingListFragment.kt val adapter = ShoppingListAdapter(data) val recyclerView: RecyclerView = findViewById(R.id.recycler_view) recyclerView.adapter = adapter recyclerView.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false)