getCardStyle (){ const {position} = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH*1.5, 0, SCREEN_WIDTH*1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [ { rotate }] } }
render() { const spin = this.state.spinValue.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] }); return ( <View style={styles.container}> <PriceList/> </View> ); }
constructor(props) { super(props); this.state={ inputText: "", } this.AnimatedTextInput = Animated.createAnimatedComponent(TextInput); this.inputRise = new Animated.Value(0); this.inputOpacity = new Animated.Value(1); this.inputHeight = this.inputRise.interpolate({ inputRange: [ 0, 1 ], outputRange: [ 0, -100 ] }); }
constructor () { super() this.tabsTop = this.tabsScroll.interpolate({ inputRange: [0, IMAGE_HEIGHT], outputRange: [IMAGE_HEIGHT + this.statusBarHeight, this.statusBarHeight], extrapolateLeft: 'extend', extrapolateRight: 'clamp', }) }
constructor(props) { super(props); this.translateX = new Animated.Value(-1); this.style = { left: this.translateX.interpolate({ inputRange: [0, 1], outputRange: ['0%', '100%'] }) }; }
getCardStyle() { const rotate = this.position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...this.position.getLayout(), transform: [{ rotate }] } }
function interpolateToString(animatedValue: Animated.Value) { return animatedValue.interpolate({ inputRange: [0, 1], outputRange: ['0', '1'], }); }
getCardStyle() { const { position } = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH*1.5, 0, SCREEN_WIDTH*1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...this.state.position.getLayout(), transform: [{ rotate: rotate }], }; }
getCardStyle() { const {position} = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }) return { ...position.getLayout(), transform: [{rotate}] } }
getCardStyle() { const { position } = this.state; // using interpolate to change rotate along with position x const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [{ rotate }] }; }
constructor(props) { super(props); this.translateX = new Animated.Value(-1); this.style = { left: this.translateX.interpolate({ inputRange: [0, 1], outputRange: ['0%', '100%'] }) }; }
getCardStyle() { const { position } = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [{ rotate }] }; }
getCardStyle() { const { position } = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [{ rotate }] }; }
getCardStyle() { const {position} = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [{rotate: rotate}] }; }
getCardStyle() { const { position } = this.state; const rotate = position.x.interpolate({ inputRange: [-SCREEN_WIDTH * 1.5, 0, SCREEN_WIDTH * 1.5], outputRange: ['-120deg', '0deg', '120deg'] }); return { ...position.getLayout(), transform: [{ rotate }] }; }