Android approach to handling landscape mode when portrait mode uses ViewPager2/TabLayout?

52 Views Asked by At

I am currently working on an app that I have completed portrait views of everything. This is my first app where I want to have robust orientation support.

So, I'm going through the process of refining the landscape orientation of views. Instead of having a horizontal tab layout on the bottom in the portrait orientation, I would like to present the user with a vertical equivalent of my TabLayout that is hooked up to the ViewPager2 on the right and show the content to the right.

Portrait Mode:

|            |
|   content  |
|            |
|------------|
| tab layout |

Desired landscape mode:

| tab |         |
| lay | content |
| out |         |

I saw another person who faked out the TabLayout by using custom views and changing the orientations by -90. But TabHost may also work?

Is there a "best" or "recommended" way to implement such a different orientation to the user? I obviously want to avoid adding unnecessary code to handling orientations as much as possible.

0

There are 0 best solutions below