Microsoft has added a brand new element to its Twin-screen structure library for supporting Navigation Rail on foldable units, such because the Floor Duo. Navigation Rail is a Materials Design element that gives a aspect navigation bar for app locations.
On units with foldable screens, a problem arises in ensuring that UI parts aren’t obscured by the hinge the place the system folds, which could happen if the weather aren’t designed for foldable units 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 assist for NavigationRailView.
Builders can use the setMenuGravity() operate to Prime, Heart, or Backside, which is able to reposition the buttons on the menu to keep away from being positioned below 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 will be added to make the transition look extra pure.
Gestures may also be used to alter the Navigation Rail place. Swiping up or down on the menu will set the gravity to both Prime or Backside, respectively.