January 2018
Intermediate to advanced
434 pages
14h 1m
English
Kotlin has some operators that we can use on a class. We will be overloading one of these operators to get views of our view group:
operator fun ViewGroup.get(position: Int): View{ return getChildAt(position)}
val view = viewContainer.get(2)// where 2 is the position for the view we want to access
val view = viewContainer[2]// where 2 is the position for the view we want to access
Read now
Unlock full access