Am new to Kotlin and been playing around with it for some time. At the moment I am still doing basic stuff, I have not reached a level where I am comfortable working with classes yet. I have some code where I am playing around with buttons and
setOnClickListener stuff. There are no functions either. However, the MainActivity.kt file has grown to around 300 lines of code (which is not much).
For an example:
I have the following code:
val resetValues = findViewById<Button>(R.id.buttonReset)
val changeColour = findViewById<Button>(R.id.buttonChangeColour)
val swopNumbers = findViewById<Button>(R.id.buttonSwopNumbers)
I was wondering if one can take each
setOnClickListener and dump them each into a separate file and just call those files from MainActivity.kt?
I understand that it will be counter productive and I should probably make use of other coding practices but this is just for me to understand and learn what can and cannot be done.