I am using databinding library. I have a layout which have some edittext for getting basic user input like name, email, password etc. I want to validate these inputs inside the viewmodel on button click. I am a bit confused how to access edittext input on button click inside the view model.
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
    <variable
        name="ViewModel"
        type="me.example.model.LoginViewModel"/>
 <EditText
    android:id="@+id/name"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textSize="13sp" />
  <Button
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_gravity="center"
     android:text="Submit"
     android:onClick="@{() -> ViewModel.onSubmitClick()}"/>
</layout>
this is the button click method in the view model
 fun onSubmitClick(){
    Log.e("Clicked ", "True")
    }
}

