Navigation Component - Multiple screen size support

Viewed 85

After reading the Navigation Component Docs multiple times, I can't figure out or find an example with this kind of scenario:

On mobile, your app shows a fragment containing a list When clicking an item a new fragment is shown with item's details

On tablet, both fragments are shown at th same time

This is the case in the Gmail application.

We can provide different layouts based on the device screen, right ? But how do i deal with that in the navigation graph ? Also, how do i handle the navigation ? For instance the user clicks a button, i call findNavController().navigate("action") But on larger screen, i should only update the data displayed in the second fragment, since he's already displayed.

Can someone help me with that ?

0 Answers
Related