I have a form as a ConstraintLayout
, like this:
"Full Name" and "Password" are aligned on their right edge, and "Full Name" is providing the margin from the ConstraintLayout
:
So far all is fine, but I wonder about how to properly handle the case where I need to change those texts programmatically. If "Full Name" gets bigger or smaller, "Password" will remain aligned:
BUT if "Password" changes its size, it will get out of screen:
I tried to use a Barrier
to get the left edge of both "Full Name" and "Password", but I couldn't get it to work, I think a Barrier
can only relate to other elements and not to align the elements of the barrier to the edges (correct me if I am wrong, please).
This case is particularly important for me to avoid making several different layouts for languages where the translation of "Full Name" and "Password" could change their sizes and make the text get out of screen.
So, how can I avoid "Full Name" and "Password" getting out of screen, if their text changes, and also have the EditText
s expand to their right edge, as in the picture?