I understand that the purpose of Android\'s data-binding library is for views to observe data and automatically update when that data changes.
Question:
I would suggest rethinking your approach. One of the primary benefits of data-binding is allowing for more expressive view code (XML in this case). While there is a balance between how much work you actually want to do in the XML vs in the view model, your case is a perfect example of too much work being done in the view model. In your code, it is not the observable fields that depend on other fields but a view's data that depends on other views' data. The observable field is just a representation of that data and when possible you should look to create dependencies in the view layer, rather than in the data layer.
The approach I would suggest is to start with the view layer (the XML) and assume you have no holistic view model but only data attached to the views. For e.g. you could start with something like this:
After this first step, you will quickly realize that the password validation logic does not make sense here because it's not trivial so you would go:
At this point, you just need a container for the username, password and confirmPassword fields so you can pass them on, so you just add the viewModel variable.
Notice how much nicer that is and you didn't even need to see the Java code at all.
P.S: you could also replace the enabled expression to something like ValidationUtils.validateEntries(username, password, confirmPassword)
if you wished. That is more a stylistic choice; it does not affect the expressivity of the view code much and anyone reading the XML can figure out what's the view is trying to achieve without looking in multiple places.