I came across the following Kotlin code for an enum:
enum class Section(val position: Int, val textKey: Int, val fragment: Fragment) {
GUIDE(0, R.string.main_pager_guide, QotGuideFragment()),
LEARN(1, R.string.main_pager_learn, QotLearnFragment()),
ME(2, R.string.main_pager_me, QotToBeVisionFragment()),
PREPARE(3, R.string.main_pager_prepare, QotPrepareFragment()),
;
}
However, when I review the Kotlin docs on enums, I don't see anything in it that shows this kind of syntax. The line:
GUIDE(0, R.string.main_pager_guide, QotGuideFragment())
I don't understand how these 3 parameters are used. Also, the enum class Section shows 3 constructor parameters that don't appear to be used.
The official docs on enum are at: