Surface Duo Bottom Navigation View

Important

This article describes functionality and guidance that is in public preview and may be substantially modified before it's generally available. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The SurfaceDuoBottomNavigationView is a customized BottomNavigationView. When the application is in dual portrait mode, the duoDisplayMode can be used to make the view render on the left or right screen.

surfaceDuoDisplayPosition - Returns or sets on which screen the view will render. Can be one of the three values:

  • DisplayPosition.START - grouped on first screen.
  • DisplayPosition.END - grouped on second screen.
  • DisplayPosition.DUAL - spanned across both screens (might appear under hinge).

START: tabs on the first screen

DisplayPosition.START

END: tabs on the first screen

DisplayPosition.END

DUAL: tabs on the first screen

DisplayPosition.DUAL

How to change the view's behavior

navView.surfaceDuoDisplayPosition = DisplayPosition.START

The same can be obtained using the app:display_position attribute in conjunction with tool:tools_application_mode.

<com.microsoft.device.dualscreen.bottomnavigation.SurfaceDuoBottomNavigationView
    android:id="@+id/nav_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:menu="@menu/bottom_nav_menu"
    .....
    app:display_position="start"
    tool:tools_application_mode="dual_screen" />