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 com.facebook.rebound.origami; | |
import android.app.Activity; | |
import android.content.res.Resources; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.ViewTreeObserver; | |
import com.facebook.rebound.SimpleSpringListener; | |
import com.facebook.rebound.Spring; |
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
(function() { | |
var hb = {}; | |
var deg2rad = rebound.MathUtil.degreesToRadians; | |
var mapVal = rebound.MathUtil.mapValueInRange; | |
hb.HamburgerButton = function(container, size, color, cornerRadius) { | |
this.canvas = document.createElement('canvas'); | |
this.ctx = this.canvas.getContext('2d'); | |
this.padding = size * 0.1; |
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 com.facebook.rebound; | |
import java.util.concurrent.CopyOnWriteArrayList; | |
public class SpringChain implements SpringListener { | |
private final SpringSystem mSpringSystem; | |
private final CopyOnWriteArrayList<SpringListener> mListeners; | |
private final CopyOnWriteArrayList<Spring> mSprings; | |
private static final SpringConfig ATTACHMENT_SPRING = SpringConfig.fromOrigamiTensionAndFriction(70, 10); |
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. |
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. |
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
'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 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'; | |
// A list of layers with initial values | |
var layers = [ | |
{ | |
name: 'red-square', | |
width: 200, | |
height: 200, | |
x: 0, | |
y: 0, |
OlderNewer