Android Kotlin. Как добавить в адаптер через submitList несколько строк? package ru.maxi.mobile.feature.delivery.latestComments

import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.SimpleItemAnimator
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import ru.maxi.mobile.R
import ru.maxi.mobile.base.ui.BaseBottomSheetFragment
import ru.maxi.mobile.databinding.FragmentLatestCommentsDialogBinding
import ru.maxi.mobile.uikit.utils.lifecycleAwareLazy

/**
 * Фрагмент для диалога выбора последнего комментария
 */
class LatestCommentsFragment : BaseBottomSheetFragment<FragmentLatestCommentsDialogBinding>(
    FragmentLatestCommentsDialogBinding::bind,
    R.layout.fragment_latest_comments_dialog,
) {

    override val analyticsName = null

    private val viewModel by viewModels<LatestCommentsViewModel>()

    private val adapter: LatestCommentsAdapter by lifecycleAwareLazy {
        LatestCommentsAdapter(
            onSelectedCommentChangeListener = viewModel::onSelectComment,
            onDeleteCommentClickListener = viewModel::onDeleteComment,
        )
    }

    override fun onCreateDialog(savedInstanceState: Bundle?): BottomSheetDialog {
        return super.onCreateDialog(savedInstanceState).apply {
            behavior.state = BottomSheetBehavior.STATE_EXPANDED
            behavior.skipCollapsed = true
        }
    }

    override fun onDialogCreated(view: View, savedInstanceState: Bundle?) {
        super.onDialogCreated(view, savedInstanceState)
        with(viewBinding) {
            commentsList.adapter = adapter
            (commentsList.itemAnimator as? SimpleItemAnimator)?.supportsChangeAnimations = false
            adapter.submitList(listOf())
        }
    }
}
package ru.maxi.mobile.feature.delivery.latestComments

import android.view.ViewGroup
import ru.maxi.mobile.common.components.radioGroup.RadioGroupAdapter
import ru.maxi.mobile.databinding.ItemLastCommentBinding
import ru.maxi.mobile.ui.common.utils.inflateAndGetRoot

class LatestCommentsAdapter(
    onSelectedCommentChangeListener: (commentId: Long) -> Unit,
    private val onDeleteCommentClickListener: (commentId: Long) -> Unit,
): RadioGroupAdapter<LatestCommentsItemViewHolder>(
    onCheckedChangeListener = {
        itemId -> onSelectedCommentChangeListener(itemId.id)
    }
) {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LatestCommentsItemViewHolder {
        val view = parent.inflateAndGetRoot(ItemLastCommentBinding::inflate)
        return LatestCommentsItemViewHolder(view)
    }

    override fun onBindViewHolder(holder: LatestCommentsItemViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)

        val item = getItem(position)
        holder.setOnDeleteCommentClickListener { onDeleteCommentClickListener(item.id.id) }
    }
}
package ru.maxi.mobile.feature.delivery.latestComments

import android.view.View
import android.widget.RadioButton
import androidx.recyclerview.widget.RecyclerView
import by.kirich1409.viewbindingdelegate.viewBinding
import ru.maxi.mobile.common.components.radioGroup.RadioGroupViewHolder
import ru.maxi.mobile.databinding.ItemLastCommentBinding

/**
 * [RecyclerView.ViewHolder] последних комментариев в доставке клиента
 */
class LatestCommentsItemViewHolder(view: View) : RecyclerView.ViewHolder(view), RadioGroupViewHolder {

    private val viewBinding by viewBinding(ItemLastCommentBinding::bind)

    private var onDeleteCommentClickListener: (() -> Unit)? = null

    override val radioButton: RadioButton
        get() = viewBinding.clientCommentButton

    init {
        viewBinding.deleteButton.setOnClickListener { onDeleteCommentClickListener?.invoke() }
    }

    /**
     * Установить обработчик [listener] вызова действия удаления комментария
     */
    fun setOnDeleteCommentClickListener(listener: () -> Unit) {
        onDeleteCommentClickListener = listener
    }
}