Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save romainbsl/6efe8a52c6146224f4de03a171b29796 to your computer and use it in GitHub Desktop.
Save romainbsl/6efe8a52c6146224f4de03a171b29796 to your computer and use it in GitHub Desktop.
class LoginActivity: AppCompatActivity(), DIAware, LoginView {
override val di by di()
val presenter: LoginPresenter by instance()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
loginButton.setOnClickListener {
presenter.login(secretEditText.text)
}
}
override fun onStart() {
super.onStart()
presenter.attachView(this)
}
override fun onDestroy() {
super.onDestroy()
presenter.detachView()
}
override fun loginSuccess() { /* Navigate to the next screen */ }
override fun loginFailure() { /* Show error to the user */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment