Skip to content

Instantly share code, notes, and snippets.

View janicduplessis's full-sized avatar
🤖
beep

Janic Duplessis janicduplessis

🤖
beep
View GitHub Profile
const HEADER_MAX_HEIGHT = 200;
const HEADER_MIN_HEIGHT = 60;
const HEADER_SCROLL_DISTANCE = HEADER_MAX_HEIGHT — HEADER_MIN_HEIGHT;
...
constructor(props) {
super(props);
this.state = {
scrollY: new Animated.Value(0),
};
}
import React, {Component} from 'react';
import {
Animated,
Image,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';
// @flow
import Relay from 'react-relay';
import Storage from './utils/Storage';
const TOKEN_KEY = 'TW_USER_TOKEN';
let _token = Storage.getItem(TOKEN_KEY, null);
NSArray *splashXibViews = [[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil];
UIView *splash = [splashXibViews objectAtIndex:0];
splash.frame = rootView.frame;
rootView.loadingView = splash;
rootView.loadingViewFadeDelay = 0.25;
rootView.loadingViewFadeDuration = 0.3;
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
class AddRemoveExample extends React.Component {
state = {
open: false,
};
componentWillUpdate() {
LayoutAnimation.easeInEaseOut();
}
_onPressAddView = () => {
[...]
const NAVBAR_HEIGHT = 64;
const STATUS_BAR_HEIGHT = Platform.select({ ios: 20, android: 24 });
class App extends Component {
[...]
render() {
[...]
class App extends Component {
constructor(props) {
[...]
const scrollAnim = new Animated.Value(0);
const offsetAnim = new Animated.Value(0);
this.state = {
input | output
0 | 0
20 | 20
40 | 20
60 | 20
50 | 10
40 | 0
50 | 10
20 | 0