Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Animated helper components #2

Merged
merged 1 commit into from
Apr 24, 2016
Merged

Add Animated helper components #2

merged 1 commit into from
Apr 24, 2016

Conversation

justinwoo
Copy link
Collaborator

@justinwoo justinwoo commented Apr 23, 2016

Usage:

import CycleAnimated from '@cycle/react-native/src/Animated';
let {Animated, Dimensions, StyleSheet, TouchableOpacity, Text, View, ScrollView, Image, AlertIOS} = React;
let windowWidth = Dimensions.get('window').width;


    <CycleAnimated.Image
        animation={Animated.spring}
        initialValue={0}
        value={(counter % 2 === 0) ? 0 : 1}
        animate={{
          height: {
            inputRange: [0, 1],
            outputRange: [100, windowWidth]
          },
          width: {
            inputRange: [0, 1],
            outputRange: [100, windowWidth]
          }
        }}
        source={{uri: "http://i.imgur.com/spJ0lss.jpg"}}
      >
      </CycleAnimated.Image>
      <CycleAnimated.Text
        animation={Animated.spring}
        initialValue={0}
        value={(counter % 2 === 0) ? 0 : 1}
        animate={{
          fontSize: {
            inputRange: [0, 1],
            outputRange: [10, 30]
          }
        }}
      >
        Whoa!!!
      </CycleAnimated.Text>
      <CycleAnimated.View
        animation={Animated.timing}
        options={{
          duration: 250
        }}
        initialValue={0}
        value={(counter % 2 === 0) ? 0 : 1}
        style={{
          backgroundColor: "red",
          height: 32
        }}
        animate={{
          opacity: {
            inputRange: [0, 1],
            outputRange: [0, 1]
          },
          width: {
            inputRange: [0, 1],
            outputRange: [100, windowWidth]
          }
        }}
      >
        <Text>Whoa!!!</Text>
      </CycleAnimated.View>

@ohanhi ohanhi merged commit 04789af into master Apr 24, 2016
@ohanhi ohanhi deleted the animated-components branch April 24, 2016 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants