APL Sequence (APL 1.4)
(This is not the most recent version of APL. Use the Other Versions option to see the documentation for the most recent version of APL)
A Sequence uses a data set to inflate a repeating set of components and display them in a long scrolling list.
Sequence is similar to a Container, the
Sequence has better performance for long lists of items. The
Sequence has a less-flexible layout model.
You can also use a Sequence to allow ordinal and anaphor-based selection of items on the screen. See APL Support for Item Selection.
The Sequence component has the following properties:
- All actionable component properties
- All multi-child component properties
- All base component properties
Sequenceproperties listed in following table. See the meaning of the columns.
true, assign ordinal numbers to children in the data-binding context.
|Array of command
|Command to run during scrolling
|The direction to scroll this sequence.
The children of a sequence are laid out in a continuous strip (either left-to-right or top-to-bottom). The dimension of the child component along the scrolling axis is
auto, meaning that it wraps the content of the child by default.
To minimize visibility errors, the height of a vertical sequence and the width of a horizontal sequence are initialized to 100dp if they are not specified. Don't use
auto for the
width. Use an absolute or relative dimension for the
Any item template inside a vertical Sequence that has a height value must use absolute dimensions and cannot have height set as a percentage value. Any item inside a horizontal Sequence that has a width value must use absolute dimensions and cannot have width set as a percentage value.
Sequence is the source or target of an event, the following values are reported in
// Sequence-specific values
"position": Number, // Scrolled position of the component, as a percentage
// General component values
"bind": Map, // Access to component data-binding context
"checked": Boolean, // Checked state
"disabled": Boolean, // Disabled state
"focused": Boolean, // Focused state
"height": Number, // Height of the component, in dp (includes the padding)
"id": ID, // ID of the component
"opacity": Number, // Opacity of the component [0-1]
"pressed": Boolean, // Pressed state
"uid": UID, // Runtime-generated unique ID of the component
"width": Number // Width of the component, in dp (includes the padding)
position value reported is calculated in the same way as the
true, set the data-binding ordinal for each of the items in the sequence. The ordinals start with "1" and increment by one unless the numbering property in a child is set to "skip" or "reset". Note that the
lastItem do not participate in ordinal numbering.
numbered property does not display any numbers on the screen automatically. You can use the
ordinal value in the data-binding context to display the numbers in a
Commands to run during scrolling. The runtime will attempt to run these commands once per drawing frame during scrolling, but there is no guarantee that it will succeed. On slow hard the onScroll command may only fire intermittently.
event.source.position reported in the command is the percentage of
the current scroll position as expressed by the width/height of the
sequence. For example, if the
Sequence is 200 pixels wide and the
contents have shifted left by 520 pixels, the reported value is 2.60.
The event generated has the following form.
... // Component source properties
Refer to Event source for a description of
The onScroll event handler runs in fast mode.
The scrollDirection is either
horizontal. Default is
Sequence is a multichild component. The
Sequence inherits all of the multichild properties.
Sequence is an actionable component. The
Sequence inherits all of the actionable properties.
The children of a sequence lay out in a continuous strip (either left-to-right or top-to-bottom). The dimension of the child along the scrolling axis is auto; that is, it wraps the content of the child by default.
The children of a Sequence support the following additional properties.
|Control ordinal numbering of the next child.
|Additional space to add between this component and the previous component in the layout.
Controls the ordinal value when the parent has set numbered. This property controls how the ordinal value will be updated for the next child in the sequence, not the current child in the sequence.
normal: The next child's ordinal = ordinal + 1.
skip: The next child's ordinal = ordinal
reset: The next child's ordinal = 1
An amount of spacing to add between this component and the previous component in the sequence. The first item in the sequence ignores spacing. The value must be expressed in absolute dimensions.
Was this page helpful?
Last updated: Nov 28, 2023