Created
August 29, 2020 13:34
-
-
Save romainbsl/6efe8a52c6146224f4de03a171b29796 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 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