Constructs a new ViewFragmentProvider and initializes the fragment holder.
PrivateallAll fragments indexed by their unique ID.
PrivateappStyle registry for resolving fragment styles.
PrivateavailableAvailable fragments for reuse, indexed by style key.
PrivatecallbackRegistry for callback types and names mapped to handler functions.
PrivatefontFont manager for resolving fonts in fragments.
PrivatefragmentHolder group for all fragment views.
PrivatefragmentInternal fragment ID counter for unique IDs.
PrivateinFragments currently checked out from the available pool (not in free stacks).
PrivateuniquePrivateviewsViews that should be removed during the next synchronization, indexed by view id.
Applies a view status (e.g., focused, normal) to a fragment.
The fragment to update.
The view status.
Creates a fragment from a style JSON definition.
The style key.
The style JSON.
The created view fragment.
PrivatecreateCreates a view from a fragment style definition.
The fragment style.
The created view group.
Creates multiple fragments for a given style key.
The style key.
The number of fragments to create.
PrivatediscardPermanently drops a stale pooled fragment: unregisters it, removes it from the master index, and detaches its SG view so it can be rebuilt.
PrivategenerateGenerates a unique fragment ID.
The unique fragment ID string.
PrivategetDebug-only: rows for fragments checked out but not yet released (parent fragmentHolder or missing parent = suspicious).
Gets the data map for a given row's style key.
The collection view row.
The data map or undefined.
Gets counts of all, available, and created fragments by style key.
The fragment counts.
Retrieves a view fragment that contains a child view with the specified HID.
The HID of the child view to find.
The view fragment or undefined if not found.
Gets a view fragment by its style key, creating one if necessary.
The style key.
The view fragment.
Gets a view fragment for a given row, using its style key.
The collection view row.
The view fragment or undefined.
Marks a fragment for removal during the next synchronization.
PrivateregisterRegisters a callback handler by type and name.
The name used in style JSON.
The function implementation.
Releases a fragment, making it available for reuse.
The fragment to release.
PrivateresolveResolves an hs_shape fragment child against theme.compiledShapes (see ShapeLoader). On Roku the child JSON is rewritten in place to a Poster pointing at the pre-generated nine-patch, with the compiled offsets played on top of the child's translation and width/height. On other platforms the child is left untouched — the HsShape node resolves its own shapeStyleKey when rendering.
Returns false only when the style is not compiled yet (retryable on the next fragment creation); malformed children are not retried.
PrivateresolveTranslates status-style updates targeting a Roku shape node (already rendered as a Poster) into the equivalent Poster field updates. Status width/height/translation are logical shape geometry, so the compiled shape offsets are played on top of them, exactly like the base geometry was during fragment hydration. Handles both shapeStyleKey swaps and geometry-only updates (which keep the shape style a previous status or the base style applied).
PrivateresolveResolves a mask child's shapeStyle against theme.compiledShapes. On
Roku the field is swizzled to maskUri (the style's launch-compiled
flat mask image) and, when the fragment declares no maskSize, the mask
is sized to the child rect — matching the native fallback; the SG
MaskGroup scales the bitmap to maskSize. On other platforms the child
is left untouched — the bridge MaskGroup resolves its own shapeStyle
when rendering.
PrivateretryRe-attempts hs_shape resolution for a fragment style whose first hydration ran before theme.compiledShapes contained every referenced style (loadShapes() not yet run, or a config reload wiped the compiled branch). Fonts and maskSize scaling are not re-applied.
PrivateshouldPrivateshouldTrue when a pooled fragment was built while its hs_shape styles were not yet compiled AND those styles now resolve. In that case its realized SG nodes are stale hs_shape nodes that cannot be rewritten, so the caller must discard it and build a fresh fragment. Re-runs the shared-style retry so the freshly built fragment picks up the compiled Posters. If the shapes still have not compiled, the pooled fragment is reused as-is (nothing better is available yet).
Removes any views previously marked for removal from their parent nodes.
Privateunregister
ViewFragmentProvider manages reusable view fragments for efficient UI rendering.
Remarks