From 42a329647bc0b1a580fe8def0595a42dc2d0a72d Mon Sep 17 00:00:00 2001 From: IjzerenHein Date: Mon, 1 Dec 2014 16:13:37 +0100 Subject: [PATCH] Minor fixes to docs --- README.md | 11 +++++------ tutorials/FlexScrollView.md | 31 ++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9c700f5..1965594 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ of renderables using a `GridLayout`, and change that into a `ListLayout`. When u ### Getting started - - [Installation](#installation) ### Core concepts @@ -28,8 +27,8 @@ of renderables using a `GridLayout`, and change that into a `ListLayout`. When u - [Layout literals](#layout-literals) - [Layout helpers](#layout-helpers) -### [FlexScrollView](#flexscrollview) -- [Tutorial](tutorial/FlexScrollView) +### [FlexScrollView](#flex-scrollview) +- [Tutorial](tutorials/FlexScrollView.md) ### [Layouts](#standard-layouts) - [GridLayout](docs/layouts/GridLayout.md) @@ -228,7 +227,7 @@ Layout helpers are special classes that simplify writing layout functions. |[LayoutDockHelper](docs/helpers/LayoutDockHelper.md)|`dock`|Layout renderables using docking semantics.| -## FlexScrollView +## Flex ScrollView FlexScrollView is a flexible and highly performant scroll-view for famo.us supporting features such as: - pull to refresh @@ -239,9 +238,9 @@ FlexScrollView is a flexible and highly performant scroll-view for famo.us suppo - bottom/right alignment - all the good stuff you expect from a scrollview and more ;) -It is based on [ScrollController](docs/ScrollController.md) which implements the core functionality of the scroll-view, which is turn is inherits from [LayoutController](docs/LayoutController.md). +It is based on [ScrollController](docs/ScrollController.md) which implements the core functionality of the scroll-view, which is turn is inherited from [LayoutController](docs/LayoutController.md). -### Take the [FlexScrollView Tutorial](tutorials/FlexScrollView.md) +### [Full FlexScrollView Tutorial](tutorials/FlexScrollView.md) ```javascript var FlexScrollView = require('famous-flex/ScrollView'); diff --git a/tutorials/FlexScrollView.md b/tutorials/FlexScrollView.md index 905d6bd..aabbdce 100644 --- a/tutorials/FlexScrollView.md +++ b/tutorials/FlexScrollView.md @@ -3,7 +3,7 @@ FlexScrollView FlexScrollView is a high performance scroll-view for famo.us based on the famous-flex LayoutController technology. The scrollview separates the actual layout algorithm from the scrollview, making it possible to select any layout into the scrollview. -By default FlexScrollView uses the [ListLayout](../docs/ListLayout.md) layout, which supports features such as [sticky headers](#sticky-headers) and [margins & spacing](#margins-spacing). +By default FlexScrollView uses the [ListLayout](../docs/layouts/ListLayout.md) layout, which supports features such as [sticky headers](#sticky-headers) and [margins & spacing](#margins--spacing-listlayout). # Index @@ -11,17 +11,17 @@ By default FlexScrollView uses the [ListLayout](../docs/ListLayout.md) layout, w - [Getting started](#getting-started) - [API reference](../docs/ScrollView.md) - [Flow mode animations](#flow-mode-animations) +- [Collection layout](#collection-layout) - [Pagination](#pagination) -- [Inserting & removing items](#inserting-removing-items) +- [Inserting & removing items](#inserting--removing-items) - [Auto event piping](#auto-event-piping) - [Getting the visible item(s)](#getting-the-visible-items) - [Scrolling](#scrolling) -- [Margins & spacing](#margins-spacing) -- [Direction & alignment](#direction-alignment) -- [Clipping & ContainerSurface's](#clipping-containersurfaces) +- [Margins & spacing](#margins--spacing-listlayout) +- [Direction & alignment](#direction--alignment) +- [Clipping & ContainerSurface's](#clipping--containersurfaces) - [Pull to refresh](#pull-to-refresh) -- [Sticky headers](#sticky-headers) -- [Collection layout](#collection-layout) +- [Sticky headers](#sticky-headers-listlayout) - [Advanced effects](#advanced-effects) - [Embedded scrollview linking](#embedded-scrollview-linking) - [Embedded scrollview scrolling restrictions](embedded-scrollview-scrolling-restrictions) @@ -67,6 +67,23 @@ var scrollView = new FlexScrollView({ }); ``` +# Collection layout + +Any layout can be selected into the FlexScrollView. Even layouts that do not support scrolling can be selected, in that case scrolling is disabled. For instance, to use the multi-cell CollectionLayout instead of the default ListLayout use: + +```javascript +var CollectionLayout = require('famous-flex/layouts/CollectionLayout'); + +var scrollView = new FlexScrollView({ + layout: CollectionLayout, + layoutOptions: { + itemSize: [50, 50], + margins: [50, 10, 50, 10], + spacing: [10, 10] + } +}); +``` + # Pagination