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
package im.wsb.example | |
import java.lang.reflect.Field; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.ViewConfiguration; | |
import android.widget.AbsListView; | |
import android.widget.ListView; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Tap to Zoom</title> | |
<!-- include rebound and the exported code --> | |
<script src="http://facebook.github.io/rebound-js/rebound.min.js"></script> | |
<script src="origami_code_export.js"></script> | |
<!-- write some simple css to layout your layers --> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Tap to Zoom</title> | |
<!-- include rebound and the exported code --> | |
<script type="text/javascript" src="http://facebook.github.io/rebound-js/rebound.min.js"></script> | |
<script type="text/javascript" src="origami_code_export.js"></script> | |
<!-- write some simple css to layout your layers --> | |
<style type="text/css"> |
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
var extend = rebound.util.extend, | |
SpringSystem = rebound.SpringSystem, | |
MathUtil = rebound.MathUtil; | |
var springSystem = new SpringSystem(); | |
/** Animation **/ | |
var Animation = function(layers, transitions) { |
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
var xfrm = function(el, xlatX, xlatY, scale, rot) { | |
xlatX = typeof xlatX === 'undefined' ? 0 : xlatX; | |
xlatY = typeof xlatY === 'undefined' ? 0 : xlatY; | |
scale = typeof scale === 'undefined' ? 1 : scale; | |
rot = typeof rot === 'undefined' ? 0 : rot; | |
var xfrm = | |
'translate3d(' + xlatX + 'px, ' + xlatY + 'px, 0px) ' + | |
'scale3d(' + scale + ', ' + scale + ', 1) ' + | |
'rotate(' + rot + 'deg)'; | |
el.style.mozTransform = el.style.msTransform = |
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
'use strict'; | |
// A list of layers with initial values | |
var layers = [ | |
{ | |
name: 'red-square', | |
width: 200, | |
height: 200, | |
x: 0, | |
y: 0, |
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
var xfrm = function(el, xlatX, xlatY, scale, rot) { | |
xlatX = typeof xlatX === 'undefined' ? 0 : xlatX; | |
xlatY = typeof xlatY === 'undefined' ? 0 : xlatY; | |
scale = typeof scale === 'undefined' ? 1 : scale; | |
rot = typeof rot === 'undefined' ? 0 : rot; | |
var xfrm = | |
'translate3d(' + xlatX + 'px, ' + xlatY + 'px, 0px) ' + | |
'scale3d(' + scale + ', ' + scale + ', 1) ' + | |
'rotate(' + rot + 'deg)'; | |
el.style.mozTransform = |
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
'use strict'; | |
var SpringChain = function(attachmentSpringConfig, mainSpringConfig) { | |
this._springSystem = new rebound.SpringSystem(); | |
this._listeners = []; | |
this._springs = []; | |
this._controlSpringIndex = -1; | |
this._attachmentSpringConfig = attachmentSpringConfig || | |
SpringChain.DEFAULT_ATTACHMENT_SPRING_CONFIG; | |
this._mainSpringConfig = mainSpringConfig || | |
SpringChain.DEFAULT_MAIN_SPRING_CONFIG; |
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
var SpringChain = function(attachmentSpringConfig, mainSpringConfig) { | |
this._springSystem = new rebound.SpringSystem(); | |
this._listeners = []; | |
this._springs = []; | |
this._controlSpringIndex = -1; | |
this._attachmentSpringConfig = attachmentSpringConfig || | |
SpringChain.DEFAULT_ATTACHMENT_SPRING_CONFIG; | |
this._mainSpringConfig = mainSpringConfig || | |
SpringChain.DEFAULT_MAIN_SPRING_CONFIG; | |
}; |
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 provided by Facebook is for non-commercial testing and evaluation purposes only. | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
NewerOlder