This repository has been archived by the owner on Dec 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed ScrollView to FlexScrollView
- Loading branch information
1 parent
459746f
commit d52b045
Showing
13 changed files
with
96 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<a name="module_FlexScrollView"></a> | ||
#FlexScrollView | ||
Flexible ScrollView drop-in replacement 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 | ||
- ScrollView linking | ||
|
||
Inherited from: [ScrollController](./ScrollController.md) | ||
|
||
<a name="module_FlexScrollView..getPosition"></a> | ||
##~~FlexScrollView~getPosition([node])~~ | ||
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*** | ||
**Scope**: inner function of [FlexScrollView](#module_FlexScrollView) | ||
**Returns**: `number` - The position of either the specified node, or the Scrollview's current Node, | ||
in pixels translated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,55 @@ | ||
<a name="module_ListLayout"></a> | ||
#ListLayout | ||
Lays out a collection of renderables from top to bottom or left to right. | ||
Lays out items and optionally sticky sections from top to bottom or left to right. | ||
|
||
|options|type|description| | ||
|---|---|---| | ||
|`[itemSize]`|Number|Height or width in pixels of the list-item| | ||
|`[itemSize]`|Number/Function|Height or width in pixels of an item (used when renderNode has no size)| | ||
|`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])| | ||
|`[spacing]`|Number|Spacing between items| | ||
|`[isSectionCallback]`|Function|Callback that is called in order to check if a render-node is a section rather than a cell.| | ||
|
||
Example: | ||
|
||
```javascript | ||
var ScrollView = require('famous-flex/ScrollView'); | ||
var ListLayout = require('famous-flex/layouts/ListLayout'); | ||
|
||
var scrollController = new ScrollController({ | ||
var scrollView = new ScrollView({ | ||
layout: ListLayout, | ||
layoutOptions: { | ||
itemSize: 40, // item has height of 40 pixels | ||
isSectionCallback: _isSection, | ||
}, | ||
dataSource: [ | ||
new Surface({content: 'item 1'}), | ||
new Surface({content: 'item 2'}), | ||
new Surface({content: 'item 3'}) | ||
// first section | ||
_createSection(), | ||
_createCell(), | ||
_createCell(), | ||
// second section | ||
_createSection(), | ||
_createCell(), | ||
] | ||
}) | ||
}); | ||
this.add(tableView); | ||
|
||
function _createCell() { | ||
return new Surface({ | ||
size: [undefined, 50], | ||
content: 'my cell' | ||
}); | ||
} | ||
|
||
function _createSection() { | ||
var section = new Surface({ | ||
size: [undefined, 30], | ||
content: 'my sticky section' | ||
}); | ||
section.isSection = true; // mark renderNode as section | ||
return section; | ||
} | ||
|
||
function _isSection(renderNode) { | ||
return renderNode.isSection; | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters