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

Animation not working #360

Open
bfp4 opened this issue May 24, 2021 · 0 comments
Open

Animation not working #360

bfp4 opened this issue May 24, 2021 · 0 comments

Comments

@bfp4
Copy link

bfp4 commented May 24, 2021

I created this laoding icon a while back and tried using it in a new project. I for some reason won't work and I can't figure out why.

`

    export default function Loading(props){
        const flipAnim = {
            0: {
                transform: [{rotate: "0deg"}]
            },
            0.25: {
                transform: [{rotate: "180deg"}]
            },
            0.5: {
                transform: [{rotate: "180deg"}]
            },
            0.75: {
                transform: [{rotate: "360deg"}]
            },
            1: {
                transform: [{rotate: "360deg"}]
            }
        }

        const fillAnim = {
            0: {
                height: "0%"
            },
            0.25: {
                height: "0%"
            },
            0.5: {
                height: "100%"
            },
            0.75: {
                height: "100%"
            },
            1: {
                height: "0%"
            }
        }
        
        return (
            <View style={{...styles.loadingCon, height: props.size}}>
                <Animatable.View 
                    style={styles.loader} 
                    animation={flipAnim}
                    duration={2000}
                    iterationCount="infinite"
                    easing="linear"
                >
                    <Animatable.View
                        style={styles.loaderInner}
                        animation={fillAnim}
                        duration={2000}
                        iterationCount="infinite"
                        easing="linear"
                    >
                    </Animatable.View>
                </Animatable.View>
            </View>
        )
    }

    const styles = StyleSheet.create({
        loadingCon: {
            justifyContent: "center",
            alignItems: "center"
        },
        loader: {
            width: 40,
            height: 40,
            borderWidth: 5,
            borderColor: constansts.colors.blues,
            borderRadius: 4
        },
        loaderInner: {
            width: "100%",
            backgroundColor: constansts.colors.blues,
        }
    })`
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

No branches or pull requests

1 participant