Microsoft has added a brand new part to its Twin-screen structure library for supporting Navigation Rail on foldable gadgets, such because the Floor Duo. Navigation Rail is a Materials Design part that gives a aspect navigation bar for app locations.
On gadgets with foldable screens, a problem arises in ensuring that UI parts aren’t obscured by the hinge the place the machine folds, which could happen if the weather aren’t designed for foldable gadgets and thus are positioned within the space the display screen folds.
To be sure that the Navigation Rail menu doesn’t battle with the display screen hinge, Microsoft has launched help for NavigationRailView.
Builders can use the setMenuGravity() operate to High, Heart, or Backside, which can reposition the buttons on the menu to keep away from being positioned beneath the display screen hinge.
NavigationRailView additionally helps animations and fling gestures. As a result of the place of the Navigation Rail is modified at runtime utilizing these strategies, a translation animation could be added to make the transition look extra pure.
Gestures will also be used to vary the Navigation Rail place. Swiping up or down on the menu will set the gravity to both High or Backside, respectively.