I want to make something that is a vertical LinearLayout
on the phone version of an app, a horizontal one for tablets.
The view in question is located inside a large XML file that specifies the entire view.
The naive way to do this is to just copy and paste the file from res/layout
to res/layout-sw600dp
. I did this and it works. However this means I know have to maintain two files if I want to make other UX changes. This is inefficient.
What is the easiest way to abstract away the LinearLayout in question?
I have looked at Custom Components but it goes farther than I would like to go. I do not want to have to make code changes for this, it should be self-contained in XML changes.