ArrayList in the below code gives unresolved reference. The IDE recommends possible import solution import of java.util.arraylist. This does not resolve the issue.
I checked the source website code and kotlin.collections arraylist import will fix the issue. Somehow the latter import is not showing up in project files.
What import library am I missing? Only java dependency is being shown in the autocomplete and kotlin one is missing. The source github url is linked below for build.gradle file if needed.
CharactersAdapter.kt
class CharactersAdapter(private val listener: CharacterItemListener) : RecyclerView.Adapter<CharacterViewHolder>() {
interface CharacterItemListener {
fun onClickedCharacter(characterId: Int)
}
private val items = ArrayList<Character>()
fun setItems(items: ArrayList<Character>) {
this.items.clear()
this.items.addAll(items)
notifyDataSetChanged()
}
https://github.com/sberoch/RickAndMorty-AndroidArchitectureSample