Package com.onec.ui.divkit
Class Div
java.lang.Object
com.onec.ui.divkit.Div
Factories + fluent styling helpers for real DivKit div nodes, emitted as plain
maps so Jackson serializes them to the DivKit JSON schema (
"type":
"container" | "text" | "gallery" | "image" | "separator" | ...). Every styling
helper mutates and returns the node so calls chain.-
Method Summary
Modifier and TypeMethodDescriptionbackground(Map<String, Object> node, String color) contentPadding(Map<String, Object> node) Outer breathing room for a content-surface root.Custom extension node — clients render it via the registeredcustom_type.Attach a client extension to a node.Scrollable list along its orientation.horizontal(List<Map<String, Object>> items) Stable node id — the anchor adiv-patch(applyPatch) targets.Text input bound totextVariable; the field's value lives in that variable.matchHeight(Map<String, Object> node) matchWidth(Map<String, Object> node) Dropdown:optionsof{value,text}, the chosen value invalueVariable.Onetabs(java.util.List<java.util.Map<java.lang.String, java.lang.Object>>)entry: a title and the content shown when it's selected.Native DivKit tabs.Share main-axis space with siblings (match_parent + weight).weightHeight(Map<String, Object> node, double weight) Size to content (not stretched to the parent) so children keep natural width.
-
Method Details
-
text
-
text
-
maxLines
-
container
-
vertical
-
horizontal
-
gallery
Scrollable list along its orientation. -
tabs
Native DivKit tabs.itemsaretab(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)entries ({title, div}). Renders as a tab strip over the selected tab's content on every official SDK. -
tab
Onetabs(java.util.List<java.util.Map<java.lang.String, java.lang.Object>>)entry: a title and the content shown when it's selected. -
grid
-
image
-
separator
-
separator
-
input
Text input bound totextVariable; the field's value lives in that variable. -
select
Dropdown:optionsof{value,text}, the chosen value invalueVariable. -
option
-
custom
Custom extension node — clients render it via the registeredcustom_type.propsare passed through DivKit'scustom_props, reaching the web client's custom element as its element properties. -
id
Stable node id — the anchor adiv-patch(applyPatch) targets. -
extension
public static Map<String,Object> extension(Map<String, Object> node, String id, Map<String, Object> params) Attach a client extension to a node. The web client looks upidin the registered extensions map and calls itsmountViewwith the rendered element +params— used to stamp DOM hooks (e.g. a row's action url for right-click menus and hover) that DivKit JSON can't express. -
action
-
color
-
background
-
corner
-
stroke
-
pad
-
contentPadding
Outer breathing room for a content-surface root. The web shell used to add this padding in React around the DivKit content; owning it in the document keeps it self-contained and consistent across every renderer and device. Single source of truth, so it can later vary by viewport in one place. -
pad
-
margins
-
gap
-
width
-
height
-
matchWidth
-
wrapWidth
Size to content (not stretched to the parent) so children keep natural width. -
matchHeight
-
weight
Share main-axis space with siblings (match_parent + weight). -
weightHeight
-
alignH
-
alignV
-
textAlign
-