ZoomRowList
ZoomRowList displays a vertically scrolling list of rows where the focused row smoothly zooms to a larger size
import { ZoomRowList } from "@roku-sdk/components";ZoomRowList(props: IZoomRowListProps): JSX.ElementDescription
ZoomRowList displays a vertically scrolling list of rows where the focused row smoothly zooms to a larger size. Each row scrolls horizontally through its items. Item rendering is delegated to compiled components specified by itemComponentName.
Parameters
| Name | Type | Description |
|---|---|---|
props | IZoomRowListProps |
Example
import "./compiled-components/MyRowItem.xml";
<zoomRowList
itemComponentName="MyRowItem"
rowWidth={1920}
rowHeight={[120, 120, 120]}
rowZoomHeight={[200, 200, 200]}
rowItemHeight={[100, 100, 100]}
rowItemZoomHeight={[180, 180, 180]}
rowItemAspectRatio={[1.777]}
content={listContent}
onRowItemFocused={([row, col]) => setFocus(row, col)}
onRowItemSelected={([row, col]) => navigate(row, col)}
/>Types
IZoomRowListProps
Properties for the ZoomRowList node.
ZoomRowList allows a row of the Row-Row Grid to smoothly zoom up to a larger size when that row has focus. Rows are capable of gaining focus while scrolling and smoothly zooming by the specified amount. The amount to zoom can be specified on a per-row basis.
ZoomRowList extends Group and uses the same data model as RowList: a root ContentNode with child ContentNodes for each row, each containing child ContentNodes for each item.
Example
import "./compiled-components/MyRowItem.xml";
<ZoomRowList
itemComponentName="MyRowItem"
rowWidth={1920}
rowHeight={[120, 120, 120]}
rowZoomHeight={[200, 200, 200]}
rowItemHeight={[100, 100, 100]}
rowItemZoomHeight={[180, 180, 180]}
rowItemAspectRatio={[1.777]}
content={listContent}
onRowItemFocused={([row, col]) => setFocus(row, col)}
onRowItemSelected={([row, col]) => navigate(row, col)}
/>| Name | Type | Description |
|---|---|---|
animateToRow? | number | When set to a valid row index, scrolls to bring that row into focus. |
content | Element | Specifies the content for the ZoomRowList. See below. |
drawFocusFeedback? | boolean | If true, the focus feedback indicator is drawn. |
drawFocusFeedbackOnTop? | boolean | If true, the focus feedback indicator is drawn on top of the items. |
fadeFocusFeedbackWhenLongPressScrolling? | boolean | If true, focus indicator fades out during long-press scrolling. |
fadeOutAboveFocus? | FadeOutAboveFocus | Controls whether rows above the focus row fade in/out as they scroll. |
focusBitmapBlendColor? | string | Blend color for the focus bitmap. |
focusBitmapUri? | Uri | Bitmap file for the focus feedback indicator. Use 9-patch for expandable regions and margins. |
itemClippingRect? | Rect2D | Specifies a clipping region for the ZoomRowItem renders. For best performance, set to match what's visible onscreen. |
itemComponentName? | string | Specifies the name of the compiled component used to render each row item. See below. |
jumpToRow? | number | When set to a valid row index, immediately moves focus to that row. |
jumpToRowItem? | RowItemPosition | When set to a valid [rowIndex, itemIndex], immediately moves focus to that item. |
onRowFocused? | EventHandler<number> | Fired when a row gains focus. Receives the index of the focused row. |
onRowItemFocused? | RowListItemEventHandler | Fired when a row item gains focus. Receives [rowIndex, itemIndex] of the newly focused item. |
onRowItemSelected? | RowListItemEventHandler | Fired when a row item is selected (OK pressed). Receives [rowIndex, itemIndex] of the selected item. |
onRowSelected? | EventHandler<number> | Fired when a row is selected. Receives the index of the selected row. |
onRowUnfocused? | EventHandler<number> | Fired when a row loses focus. Receives the index of the unfocused row. |
remainZoomedAboveFocus? | RemainZoomedAboveFocus | Controls whether rows above the focus row remain zoomed as they scroll. |
rowCounterColor? | string[] | Color of the Row Counter text for each row. |
rowCounterFont? | FontValue | Font for the Row Counter text. |
rowCounterOffset? | Vector2D[] | Offset of the Row Counter for each row. X is right edge position (right-aligned). |
rowDecorationComponentName? | string[] | Specifies the name of an XML component to decorate each row. An instance is created for each visible row. |
rowHeight? | number[] | Specifies the height of each ZoomRowItem when the row is not zoomed. At least one value must be specified. |
rowItemAspectRatio? | number[] | Aspect ratio of Items in each Row (width/height). Used to compute item width from interpolated height. E.g. 16:9 = 1.7777778. |
rowItemHeight? | number[] | Height of each Item in a Row when the row is unfocused. |
rowItemYOffset? | number[] | Vertical position of the Row relative to the top of its ZoomRowItem when unfocused. |
rowItemZoomHeight? | number[] | Height of each Item in a Row when the row is focused (zoomed). |
rowItemZoomYOffset? | number[] | Vertical position of the Row relative to the top of its ZoomRowItem when focused (zoomed). |
rowTitleColor? | string[] | Color of the Row Title text for each row. |
rowTitleFont? | FontValue | Font for the Row Title text. |
rowTitleOffset? | Vector2D[] | Offset of the Row Title for each row. [x, y] from left edge and top. |
rowWidth? | number | Specifies the maximum width of items in each row before items wrap. Also used for Row Counter positioning. |
rowZoomHeight? | number[] | Specifies the height of each ZoomRowItem when the row is zoomed. If not specified, rows do not zoom. |
showRowCounter? | boolean[] | Specifies whether each row's Row Counter is displayed. |
showRowCounterForShortRows? | boolean | When true, Row Counter is shown for all rows. When false, not shown for rows where total zoomed width of items is less than rowWidth. |
showRowTitle? | boolean[] | Specifies whether the row title is displayed for each row. |
spacingAfterRow? | number | Specifies the spacing between rows. Not scaled by zoom. |
spacingAfterRowItem? | number[] | Horizontal spacing between Items in each Row. Scales with zoom as the row gains focus. |
useDefaultAspectRatio? | boolean[] | If true, use rowItemAspectRatio for all items. If false, use aspectRatio from each item's ContentNode when available. |
wrap? | boolean | If true, items wrap from bottom to top. |
wrapDividerBitmapBlendColor? | string | Blend color for the wrap divider bitmap. |
wrapDividerBitmapUri? | Uri | Bitmap file for the wrap divider between last and first items. |
wrapDividerHeight? | number | Height of the wrap divider bitmap. |
wrapDividerOffset? | Vector2D | Offset to adjust the wrap divider position from its default. |
wrapDividerWidth? | number | Width of the wrap divider bitmap. Defaults to rowWidth if not specified. |
Extends IGroupProps.
IZoomRowListProps.content
Specifies the content for the ZoomRowList.
The root ContentNode should have one child per row. Each row child should have one child ContentNode per item in that row.
IZoomRowListProps.itemComponentName
Specifies the name of the compiled component used to render each row item.
Register the compiled component by importing its XML file before use. The component may define: width, height, index, rowIndex, itemHasFocus, rowHasFocus, rowListHasFocus, itemContent, focusPercent, rowFocusPercent, rowHeightPercent.
FadeOutAboveFocus
Controls whether rows above the focus row fade in/out as they scroll.
focusIsAtTop: when itemClippingRect top is 0, rows fade as they enter/exit from abovenever: rows do not fade as they enter/exit from abovealways: rows always fade as they enter/exit from above
type FadeOutAboveFocus = "focusIsAtTop" | "never" | "always";RemainZoomedAboveFocus
Controls whether rows above the focus row remain zoomed or unzoom as they scroll.
focusIsAtTop: when itemClippingRect top is 0, rows remain zoomed as they enter/exit from abovenever: rows zoom up/down as they enter/exit the focus region from abovealways: rows always remain zoomed as they enter/exit from above
type RemainZoomedAboveFocus = "focusIsAtTop" | "never" | "always";Updated about 5 hours ago