Skip to content

Instantly share code, notes, and snippets.

@theerasan
Created July 11, 2017 18:45
Show Gist options
  • Save theerasan/fcfcd61d272d2bf19e870700723f81d5 to your computer and use it in GitHub Desktop.
Save theerasan/fcfcd61d272d2bf19e870700723f81d5 to your computer and use it in GitHub Desktop.
var binding: ActivityLoginArch2WaysBindingBinding? = null
var viewModel: LoginArch2WaysBindingViewModel? = null
var presenter: LoginArch2WaysBindingInf.PresenterInf? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initView()
initViewModel()
initPresenter()
}
private fun initView() {
binding = DataBindingUtil.setContentView(this, R.layout.activity_login_arch_2_ways_binding)
}
private fun initViewModel() {
viewModel = LoginArch2WaysBindingViewModel()
binding!!.viewModel = viewModel
}
private fun initPresenter() {
presenter = LoginArch2WaysBindingPresenter(viewModel, this)
presenter!!.onInit()
}
override fun performLogin(stringToShow: String) {
Toast.makeText(this, stringToShow, Toast.LENGTH_LONG).show()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment