Avatar ·

ListAdapter não atualiza o item no RecyclerView: os dados mudam, mas a UI não é redesenhada

Olá a todos! Sou novo em Kotlin e desenvolvimento Android. Estou usando ListAdapter para RecyclerView, mas me deparei com um problema estranho: quando eu mudo os dados na lista e chamo submitList(), os itens não são atualizados na tela. Aqui está meu código: ```kotlin data class Item(val id: Int, var title: String, var isCompleted: Boolean) class ItemDiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame(oldItem: Item, newItem: Item): Boolean { return oldItem.id == newItem.id } override fun areContentsTheSame(oldItem: Item, newItem: Item): Boolean { return oldItem == newItem } } class ItemAdapter : ListAdapter(ItemDiffCallback()) { // ... ViewHolder e bind } // Na Activity val items = mutableListOf( Item(1, "Tarefa 1", false), Item(2, "Tarefa 2", true) ) adapter.submitList(items) // Tentando atualizar o item items[0].isCompleted = true adapter.submitList(items) // Não funciona! ``` Eu m