Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Latest commit

 

History

History
136 lines (102 loc) · 5.72 KB

FlexScrollView.md

File metadata and controls

136 lines (102 loc) · 5.72 KB

#FlexScrollView Flexible FlexScrollView for famo.us.

Key features:

  • Customizable layout (uses ListLayout by default)
  • Insert/remove at any position using animations
  • Support for true size renderables
  • Pull to refresh (header & footer)
  • Horizontal/vertical direction
  • Top/left or bottom/right alignment
  • Pagination
  • Option to embed in a ContainerSurface
  • FlexScrollView linking

Inherited from: ScrollController

##class: FlexScrollView ⏏ Extends: ScrollController
Members

###new FlexScrollView(options) Params

  • options Object - Configurable options (see ScrollController for all inherited options).
    • [pullToRefreshHeader] Renderable - Pull to refresh renderable that is displayed when pulling down from the top.
    • [pullToRefreshFooter] Renderable - Pull to refresh renderable that is displayed when pulling up from the bottom.
    • [leadingScrollView] FlexScrollView - Leading scrollview into which input events are piped (see Tutorial)
    • [trailingScrollView] FlexScrollView - Trailing scrollview into which input events are piped (see Tutorial)

Extends: ScrollController
###flexScrollView.getPosition Returns the position associated with the Scrollview instance's current node (generally the node currently at the top).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Params

  • [node] number - If specified, returns the position of the node at that index in the Scrollview instance's currently managed collection.

Deprecated
Returns: number - The position of either the specified node, or the Scrollview's current Node, in pixels translated.
###flexScrollView.setOptions(options) Patches the FlexScrollView instance's options with the passed-in ones.

Params

  • options Object - Configurable options (see ScrollController for all inherited options).
    • [pullToRefreshHeader] Renderable - Pull to refresh renderable that is displayed when pulling down from the top.
    • [pullToRefreshFooter] Renderable - Pull to refresh renderable that is displayed when pulling up from the bottom.
    • [leadingScrollView] FlexScrollView - Leading scrollview into which input events are piped (see Tutorial).
    • [trailingScrollView] FlexScrollView - Trailing scrollview into which input events are piped (see Tutorial).

Returns: FlexScrollView - this
###flexScrollView.sequenceFrom(node) Sets the data-source (alias for setDataSource).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Params

  • node Array | ViewSequence - Either an array of renderables or a Famous viewSequence.

Returns: FlexScrollView - this
###flexScrollView.getCurrentIndex() Returns the index of the first visible renderable.

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Returns: Number - The current index of the ViewSequence
###flexScrollView.goToPage(index) Paginates the Scrollview to an absolute page index. This function is a shim provided for compatibility with the stock famo.us Scrollview.

Params

  • index Number - view-sequence index to go to.

Returns: FlexScrollView - this
###flexScrollView.getOffset() Returns the offset associated with the Scrollview instance's current node (generally the node currently at the top).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Returns: number - The position of either the specified node, or the Scrollview's current Node, in pixels translated.
###flexScrollView.showPullToRefresh([footer]) Shows the pulls-to-refresh renderable indicating that a refresh is in progress.

Params

  • [footer] Bool - set to true to show pull-to-refresh at the footer (default: false).

Returns: FlexScrollView - this
###flexScrollView.hidePullToRefresh([footer]) Hides the pull-to-refresh renderable in case it was visible.

Params

  • [footer] Bool - set to true to hide the pull-to-refresh at the footer (default: false).

Returns: FlexScrollView - this
###flexScrollView.isPullToRefreshVisible([footer]) Get the visible state of the pull-to-refresh renderable.

Params

  • [footer] Bool - set to true to get the state of the pull-to-refresh footer (default: false).