In order to avoid using several nested layouts, I'm making use of a ConstraintLayout
.
I have 2 TextView
, A and B. A is on top of B. A and B contain some text that is defined by the user. So A can be shorter than B, and B can be shorter than A, at execution time.
I have a Button
, C. C is at right of A and at right of B too. I've wrote, for the moment: start_ToEndOf(R.id.A)
.
The problem: if B is longer than A, C will hide it. What I'm looking for would be a way to tell: "C, your constraint for start is: ToEndOf(R.id.A) if B is shorter than A. Otherwise, it would be: ToEndOf(R.id.B)".
Is it possible using only XML or must I use Java?