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
... | |
onPress() { | |
this.circleTransition.animate(); | |
} | |
render() { | |
return ( | |
<TouchableWithoutFeedback onPress={this.onPress.bind(this)}> | |
<View style={styles.container}> | |
<CircleTransition | |
ref={(circle) => { this.circleTransition = circle }} |
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
... | |
getLeftPosition () { | |
const halfSize = size / 2; | |
const halfWidth = width / 2; | |
let marginHorizontalTopLeft = -halfSize; | |
return marginHorizontalTopLeft + halfWidth; | |
} | |
getTopPosition () { | |
const halfSize = size / 2; | |
let marginVerticalTopLeft = -halfSize; |
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
... | |
onPress() { | |
Animated.timing(this.state.scale, { | |
toValue: 4, | |
duration: 1000, | |
easing: Easing.linear | |
}).start(() => { | |
this.setState({ | |
scale: new Animated.Value(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
... | |
constructor(props) { | |
super(props); | |
this.state = { | |
scale: new Animated.Value(0) | |
}; | |
} | |
componentDidMount() { | |
Animated.timing(this.state.scale, { | |
toValue: 4, |
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
import React from 'react'; | |
import { StyleSheet, | |
View, | |
Animated, | |
Dimensions | |
} from 'react-native'; | |
const { width, height } = Dimensions.get('window'); | |
const size = Math.min(width, height) - 1; | |
export default class App extends React.Component { | |
render() { |
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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
// To export a module named TwitterSignin |
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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
//specifing to use main-thread-only iOS API |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
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
import { Text, View, TouchableHighlight, NativeModules, Alert } from 'react-native'; | |
const { TwitterSignin } = NativeModules; | |
... | |
onLoginClick() { | |
TwitterSignin.logIn((error, loginData) => { | |
if (error) { | |
// Login failed | |
Alert.alert('Error'); | |
return; | |
} |
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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
//specifing to use main-thread-only iOS API |