I'm doing an Android project and I'm trying to figure out how to be dynamic in layouts.
So I have layout files complex_card.xml
and simple_card.xml
, each containing a ConstraintLayout
tag with some other layout elements inside. complex_card
takes more space than simple_card
so I will use complex_card
whenever I have a lot of space and can switch back to using simple_card
when I don't have space.
In activity_main.xml
, I've use both of the layouts via <include layout="R.layout.complex_card"/>
tags. However, in real time, I want to be able to change that to <include layout="R.layout.simple_card"/>
. How can I do that?