Is there a way to influence the button widget layout according to screen orientation without adding an extra layout for each orientation?
For instance
portrait:
<android:id="@+id/button"
android:text="@string/title"
android:drawableTop="@drawable/icon" />
and landscape:
<android:id="@+id/button"
android:text="@string/title"
android:drawableLeft="@drawable/icon" />
You can extract that attribute and add a style for the button
and then create two different style files, one in
res/valuesand one inres/values-land, using the normal resource folder qualifiers. They could look like this:res/values/styles.xml
res/values-land/styles.xml
See defining styles for more documentation how to do that exactly.