This should be pretty basic, since I am new to Kotlin.
I am trying to wrap my head around this simple code that displays the position of the seekbar.
I think I understand what the first line is doing. It is applying the method setOnSeekBarChangeListener on the object y (which is the SeekBar). But what is the next line doing? I don’t think SeekBar on the second line is an object, so it is unclear to me what the method .OnSeekBarChangeListener might be acting on. A plain language explanation would be highly appreciated.
y.setOnSeekBarChangeListener(
object: SeekBar.OnSeekBarChangeListener{
override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
x.text = p1.toString()
}
override fun onStartTrackingTouch(p0: SeekBar?) {}
override fun onStopTrackingTouch(p0: SeekBar?) {}
})