-2

I have an Android app that has a main menu that leads into a number of secondary menus depending on the button initially pressed. This secondary menu then opens the final screen with whatever the user is to interact with. This behavior is shown in the bottom three screens.

However, this experience isn't great in tablets or foldables. Is there a way I could make it so that tablets and open foldables have a different layout (the one shown in the top three screens) where the third screen also opens alongside the second?

Thank you so much!

Example of behaviour I want

Marvil
  • 17
  • 4
  • Does this answer your question? [ConstraintLayout Flow helper example](https://stackoverflow.com/questions/54874011/constraintlayout-flow-helper-example) – Sergei Kozelko Apr 18 '23 at 06:36

1 Answers1

0

You could use Fragments in your App to get the desired behaviour.

How to do it:

  1. Create two different layou files for one container Activity. (One for the landscape tablet and one for the portrait phone) You can do this by creating one layout and adding a second "landscape" or "tablet" Version to it.

  2. Create two different Fragments for your different views.

  3. Instantiate the Fragments when turning your Tablet and display two Fragments at once.

This should get you the desired behavior with the added bonus of being able to reuse your fragments when having different sizes of devices...

TIMBLOCKER
  • 328
  • 4
  • 15