September 2018
Intermediate to advanced
386 pages
11h 17m
English
Often, we need to play with the view's visibility. Extension functions can help us here. In the ViewExtensions.kt file, there are two extension functions written inside:
fun View.show() { this.visibility = View.VISIBLE}fun View.hide() { this.visibility = View.GONE}
Now, suppose you want to change the visibility of any of the views; you can write the code in the following way:
emailPasswordButtons.hide()emailPasswordFields.hide()signedInButtons.show()
Read now
Unlock full access