Package com.onec.ui.divkit
Class ShellLayoutBuilder
java.lang.Object
com.onec.ui.divkit.ShellLayoutBuilder
Emits the app chrome as two independent DivKit cards — the
topbar (brand
+ actions) and the nav — so the client can position them per
NavStyle: nav as a horizontal TOPBAR, a vertical SIDEBAR
rail, or a pinned BOTTOM_BAR. Splitting them lets a sidebar sit beside
content and a bottom bar pin below it; a single combined card couldn't do both.
Navigation/profile/logout intents are onec:// action URLs the host
maps to routes, profile re-fetches, and session calls.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA branding logo for the shell header / mobile menu: the (theme-resolved) image URL plus optional fixedwidth/heightin dp.static final recordstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe DivKit variable holding the current route. -
Method Summary
Modifier and TypeMethodDescriptionaccount(String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p) The account island: the signed-in user, any persona switcher, and the theme / sign-out actions.menu(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p) The full-screen mobile menu: every navigation destination grouped by section as tappable rows, with the account block (persona switcher, theme, sign-out) below.nav(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, NavStyle style, boolean compact, Palette p) The navigation card, shaped for the chosenNavStyle.
-
Field Details
-
ACTIVE_VAR
The DivKit variable holding the current route. Nav item colors bind to it via expressions, so the active highlight follows navigation client-side without re-fetching the shell — the host updates this one variable on each route change.- See Also:
-
-
Method Details
-
account
public static Map<String,Object> account(String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p) The account island: the signed-in user, any persona switcher, and the theme / sign-out actions. On desktop it sits under the nav rail; on mobile it's served as the/accountpage (reached from a bottom-bar tab).
-