Last active
March 2, 2019 13:11
-
-
Save makorowy/f91643aff28cff35acc7bf4ee95383ad to your computer and use it in GitHub Desktop.
Sample for article needs - How to create a compound view?
This file contains hidden or 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
| class MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| consent1.setOnCheckedChangeListener { _, _ -> validateConsents() } | |
| consent2.setOnCheckedChangeListener { _, _ -> validateConsents() } | |
| } | |
| private fun validateConsents() { | |
| confirmButton.isEnabled = consent1.isChecked && consent2.isChecked | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment