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

Commit

Permalink
Added AnimationController.
Browse files Browse the repository at this point in the history
  • Loading branch information
IjzerenHein committed Apr 22, 2015
1 parent 9c5af4e commit 9adfffd
Show file tree
Hide file tree
Showing 7 changed files with 722 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = function(grunt) {
{ src: 'src/FlexScrollView.js', dest: 'docs/FlexScrollView.md' },
{ src: 'src/LayoutUtility.js', dest: 'docs/LayoutUtility.md' },
{ src: 'src/VirtualViewSequence.js', dest: 'docs/VirtualViewSequence.md' },
{ src: 'src/AnimationController.js', dest: 'docs/AnimationController.md' },
// widgets
{ src: 'src/widgets/DatePicker.js', dest: 'docs/widgets/DatePicker.md' },
{ src: 'src/widgets/TabBar.js', dest: 'docs/widgets/TabBar.md' },
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ of renderables using a `CollectionLayout`, and change that into a `ListLayout`.

### Views / widgets
- [LayoutController](docs/LayoutController.md)
- [AnimationController](https://github.com/IjzerenHein/famous-flex-animationcontroller/blob/master/tutorial/AnimationController.md)
- [ScrollController](docs/ScrollController.md)
- [FlexScrollView](tutorials/FlexScrollView.md)
- [DatePicker](https://github.com/IjzerenHein/famous-flex-datepicker/blob/master/tutorial/DatePicker.md)
Expand Down Expand Up @@ -252,6 +253,7 @@ Layout helpers are special classes that simplify writing layout functions.
|Class|Description|
|---|---|
|[LayoutController](docs/LayoutController.md)|Lays out renderables and optionally animates between layout states.|
|[AnimationController](https://github.com/IjzerenHein/famous-flex-animationcontroller/blob/master/tutorial/AnimationController.md)|Animating between famo.us views in awesome ways.|
|[ScrollController](docs/ScrollController.md)|Scrollable LayoutController (base class for FlexScrollView).|
|[FlexScrollView](tutorials/FlexScrollView.md)|Flexible scroll-view with pull-to-refresh, margins & spacing and more good stuff.|
|[DatePicker](https://github.com/IjzerenHein/famous-flex-datepicker/blob/master/tutorial/DatePicker.md)|Date/time picker wheel.|
Expand Down
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"famousflex",
"layoutcontroller",
"scrollcontroller",
"animationcontroller",
"scrollview",
"flexscrollview",
"flex-scrollview",
Expand Down
98 changes: 98 additions & 0 deletions docs/AnimationController.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<a name="module_AnimationController"></a>
## AnimationController
Animating between famo.us views in awesome ways.


* [AnimationController](#module_AnimationController)
* [AnimationController](#exp_module_AnimationController--AnimationController)
* [new AnimationController([options])](#new_module_AnimationController--AnimationController_new)
* _instance_
* [.show(renderable, [options], [callback])](#module_AnimationController--AnimationController#show) ⇒ <code>AnimationController</code>
* [.hide([options], [callback])](#module_AnimationController--AnimationController#hide) ⇒ <code>AnimationController</code>
* [.halt()](#module_AnimationController--AnimationController#halt) ⇒ <code>AnimationController</code>
* [.get()](#module_AnimationController--AnimationController#get) ⇒ <code>Renderable</code>
* _static_
* [.Animation](#module_AnimationController--AnimationController.Animation)

<a name="exp_module_AnimationController--AnimationController"></a>
### AnimationController ⏏
**Kind**: Exported class
<a name="new_module_AnimationController--AnimationController_new"></a>
#### new AnimationController([options])

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Configurable options. |
| [options.transition] | <code>Object</code> | Transition options (default: `{duration: 400, curve: Easing.inOutQuad}`). |
| [options.animation] | <code>function</code> | Animation function (default: `AnimationController.Animation.Slide.Left`). |
| [options.show] | <code>Object</code> | Show specific options. |
| [options.show.transition] | <code>Object</code> | Show specific transition options. |
| [options.show.animation] | <code>function</code> | Show specific animation function. |
| [options.hide] | <code>Object</code> | Hide specific options. |
| [options.hide.transition] | <code>Object</code> | Hide specific transition options. |
| [options.hide.animation] | <code>function</code> | Hide specific animation function. |
| [options.transfer] | <code>Object</code> | Transfer options. |
| [options.transfer.transition] | <code>Object</code> | Transfer specific transition options. |
| [options.transfer.zIndex] | <code>function</code> | Z-index the tranferables are moved on top while animating (default: 10). |
| [options.transfer.items] | <code>Array</code> | Ids (key/value) pairs (source-id/target-id) of the renderables that should be transferred. |

<a name="module_AnimationController--AnimationController#show"></a>
#### animationController.show(renderable, [options], [callback]) ⇒ <code>AnimationController</code>
Shows a renderable using an animation and hides the old renderable.

When multiple show operations are executed, they are queued and
shown in that sequence. Use `.halt` to cancel any pending show
operations from the queue.

**Kind**: instance method of <code>[AnimationController](#exp_module_AnimationController--AnimationController)</code>
**Returns**: <code>AnimationController</code> - this

| Param | Type | Description |
| --- | --- | --- |
| renderable | <code>Renderable</code> | View or surface to show |
| [options] | <code>Object</code> | Show options |
| [options.transition] | <code>Object</code> | Transition options for both show & hide. |
| [options.animation] | <code>function</code> | Animation function for both show & hide. |
| [options.show] | <code>Object</code> | Show specific options. |
| [options.show.transition] | <code>Object</code> | Show specific transition options. |
| [options.show.animation] | <code>function</code> | Show specific animation function. |
| [options.hide] | <code>Object</code> | Hide specific options. |
| [options.hide.transition] | <code>Object</code> | Hide specific transition options. |
| [options.hide.animation] | <code>function</code> | Hide specific animation function. |
| [options.transfer] | <code>Object</code> | Transfer options. |
| [options.transfer.transition] | <code>Object</code> | Transfer specific transition options. |
| [options.transfer.zIndex] | <code>function</code> | Z-index the tranferables are moved on top while animating (default: 10). |
| [options.transfer.items] | <code>Array</code> | Ids (key/value) pairs (source-id/target-id) of the renderables that should be transferred. |
| [callback] | <code>function</code> | Function that is called an completion. |

<a name="module_AnimationController--AnimationController#hide"></a>
#### animationController.hide([options], [callback]) ⇒ <code>AnimationController</code>
Hides the current view with an animation.

**Kind**: instance method of <code>[AnimationController](#exp_module_AnimationController--AnimationController)</code>
**Returns**: <code>AnimationController</code> - this

| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>Object</code> | Hide options |
| [options.transition] | <code>Object</code> | Hide transition options. |
| [options.animation] | <code>function</code> | Hide animation function. |
| [callback] | <code>function</code> | Function that is called an completion. |

<a name="module_AnimationController--AnimationController#halt"></a>
#### animationController.halt() ⇒ <code>AnimationController</code>
Clears the queue of any pending show animations.

**Kind**: instance method of <code>[AnimationController](#exp_module_AnimationController--AnimationController)</code>
**Returns**: <code>AnimationController</code> - this
<a name="module_AnimationController--AnimationController#get"></a>
#### animationController.get() ⇒ <code>Renderable</code>
Gets the currently visible or being shown renderable.

**Kind**: instance method of <code>[AnimationController](#exp_module_AnimationController--AnimationController)</code>
**Returns**: <code>Renderable</code> - currently visible view/surface
<a name="module_AnimationController--AnimationController.Animation"></a>
#### AnimationController.Animation
Out of the box supported animations.

**Kind**: static property of <code>[AnimationController](#exp_module_AnimationController--AnimationController)</code>
7 changes: 7 additions & 0 deletions docs/ScrollController.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Inherited from: [LayoutController](./LayoutController.md)
* [.isScrolling()](#module_ScrollController--ScrollController#isScrolling) ⇒ <code>Bool</code>
* [.getBoundsReached()](#module_ScrollController--ScrollController#getBoundsReached) ⇒ <code>ScrollController.Bounds</code>
* [.getVelocity()](#module_ScrollController--ScrollController#getVelocity) ⇒ <code>Number</code>
* [.getEnergy()](#module_ScrollController--ScrollController#getEnergy) ⇒ <code>Number</code>
* [.setVelocity(velocity)](#module_ScrollController--ScrollController#setVelocity) ⇒ <code>ScrollController</code>
* [.applyScrollForce(delta)](#module_ScrollController--ScrollController#applyScrollForce) ⇒ <code>ScrollController</code>
* [.updateScrollForce(prevDelta, newDelta)](#module_ScrollController--ScrollController#updateScrollForce) ⇒ <code>ScrollController</code>
Expand Down Expand Up @@ -261,6 +262,12 @@ Get the current scrolling velocity.

**Kind**: instance method of <code>[ScrollController](#exp_module_ScrollController--ScrollController)</code>
**Returns**: <code>Number</code> - Scroll velocity
<a name="module_ScrollController--ScrollController#getEnergy"></a>
#### scrollController.getEnergy() ⇒ <code>Number</code>
Get the current energy of the scrolling particle.

**Kind**: instance method of <code>[ScrollController](#exp_module_ScrollController--ScrollController)</code>
**Returns**: <code>Number</code> - Energy
<a name="module_ScrollController--ScrollController#setVelocity"></a>
#### scrollController.setVelocity(velocity) ⇒ <code>ScrollController</code>
Set the scrolling velocity.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"famousflex",
"layoutcontroller",
"scrollcontroller",
"animationcontroller",
"scrollview",
"flexscrollview",
"flex-scrollview",
Expand Down
Loading

0 comments on commit 9adfffd

Please sign in to comment.