Created
October 15, 2020 10:11
-
-
Save harshalbhakta/29aa1b2900ed386fb9d83db760d74558 to your computer and use it in GitHub Desktop.
Kotlin Apply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before | |
binding.nicknameText.text = binding.nicknameEdit.text | |
binding.nicknameEdit.visibility = View.GONE | |
binding.doneButton.visibility = View.GONE | |
binding.nicknameText.visibility = View.VISIBLE | |
// after | |
binding.apply { | |
nicknameText.text = nicknameEdit.text.toString() | |
nicknameEdit.visibility = View.GONE | |
doneButton.visibility = View.GONE | |
nicknameText.visibility = View.VISIBLE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment