Screen rotation
Most, if not all, mobile devices allow for screen reorientation. Many apps, such as video players, are better suited to one orientation than another. Generally speaking, we want our apps to look their best, however rotated.
Most layouts look terrible when translated from portrait to landscape or vice versa. Clearly, we need to create alternatives for these situations. Fortunately, we do not have to start from scratch. The best way to see how this is done is to start with a standard portrait layout like the one here:
This can be recreated with the following code:
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/header" android:layout_width="match_parent" android...