ScrollingLayout
A scrollable container that wraps a layout view with optional filtering and borders.
ScrollingLayout provides a scrollable viewport for any layout view, with additional features like density-aware filtering, automatic scrolling bounds management, and optional view culling for performance optimization.
Key features:
- Generic layout view support (any View subclass)
- Automatic content sizing and scroll bounds
- Optional border rendering
- View culling for large lists (via checkChildrenOfView)
- Platform-specific scroll behavior (touch vs desktop)
Usage example:
var layout = new ColumnLayout();
var scrollingLayout = new ScrollingLayout(layout, true); // with borders
scrollingLayout.size(300, 200);
scrollingLayout.checkChildrenOfView = layout; // enable view culling
add(scrollingLayout);
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Custom theme override for this scrolling layout. If null, uses the global context theme
The wrapped layout view that provides the scrollable content
Optional view whose children will be culled when outside the visible area.
When set, children of this view that are completely outside the scroll viewport will have their visibility set to false for performance optimization. This is particularly useful for large lists or grids.
Density-aware filter for crisp rendering at different screen densities
Creates a new ScrollingLayout wrapping the provided layout view.
Name | Type | Default | Description |
---|---|---|---|
layoutView |
elements.ScrollingLayout.T | The layout view to make scrollable | |
withBorders |
Bool | false |
Whether to add visual borders (top border on content, bottom border on container) |
Private Members
emitObservedDirty(instance: ScrollingLayout<elements.ScrollingLayout.T>, fromSerializedField: Bool): Void
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
ScrollingLayout<elements.ScrollingLayout.T> |
fromSerializedField |
Bool |
Event when theme field changes.
Name | Type |
---|---|
current |
Theme |
previous |
Theme |
Performs layout of the scrolling content and manages scroll bounds.
This method:
- Sizes the filter and scroller to match the container
- Computes the layout view size based on scroll direction
- Ensures scroll position stays within valid bounds
- Updates content view size to match layout view
Handles post-update logic including view culling and density updates.
Updates the filter density for crisp rendering and performs view culling if checkChildrenOfView is set. Views outside the visible scroll area are hidden for performance.
Name | Type | Description |
---|---|---|
delta |
Float | Time delta since last update |
Updates the visual style based on the current theme.
Currently only updates the border alpha for window-style borders.
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |