F
F
foonfyrick2021-04-25 09:12:49
Android
foonfyrick, 2021-04-25 09:12:49

Without using dataBinding, what would be a similar entry?

There is such an entry using dataBinding.
In this case, it is enough to write like this, and all variables from the ViewModel class will be associated with the layout id.
6085077f77c37613141491.png

And if you do not use dataBinding, then I have to assign all the variables, but this approach seems bad to me:

fun onLoginButtonClick(view: View) {
        viewModel.email = binding.edtEmail.toString()
        viewModel.password = binding.edtPassword.toString()
        viewModel.onLoginButtonClick(view)
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question