Created
January 19, 2018 22:12
-
-
Save dcampogiani/2eb139a19b3307044d45c9fd24da1c34 to your computer and use it in GitHub Desktop.
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
class OptionActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_input) | |
val viewModel = ViewModelProviders.of(this)[OptionViewModel::class.java] | |
signup_button.setOnClickListener { | |
viewModel.validate(email.text.toString(), number.text.toString()) | |
} | |
viewModel.validation.observe(this, Observer { | |
it?.fold(this::handleNone, this::handleSome) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment