Package su.onno.ui.divkit
Class ShellLayoutBuilder
java.lang.Object
su.onno.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 onno:// 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, String avatarUrl, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg) account(String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p) Back-compat overload: no avatar, English defaults (used by unit tests).account(String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg) Back-compat overload: no avatar.menu(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, String userName, String avatarUrl, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, boolean notifications, Palette p, UiMessages msg) menu(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, String userName, String avatarUrl, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg) Back-compat overload: no notifications row.menu(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p) Back-compat overload: no avatar, English defaults (used by unit tests).menu(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg) Back-compat overload: no avatar.nav(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, NavStyle style, boolean compact, Palette p) Back-compat overload rendering the English defaults (used by unit tests).nav(String brand, ShellLayoutBuilder.Logo logo, List<ShellLayoutBuilder.NavSection> nav, NavStyle style, boolean compact, Palette p, UiMessages msg)
-
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) Back-compat overload: no avatar, English defaults (used by unit tests). -
account
public static Map<String,Object> account(String userName, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg) Back-compat overload: no avatar. -
account
public static Map<String,Object> account(String userName, String avatarUrl, List<ShellLayoutBuilder.ProfileLink> profiles, String activeProfileId, Palette p, UiMessages msg)
-