As you can see in the image below, I'm looking for a way to have 2 views, and I need that when both are visible, view 2 behave as a wrap_parent, but when view 1 is gone, I will like to view 2 to take the remaining of the space.
I know constraint layout can accomplish this; I haven't found a way to do it.
Here is an example of what I'm looking for
Edit 1
Neither of these views is view groups.

