Git Product home page Git Product logo

vikrantnegi / react-native-animated-loader Goto Github PK

View Code? Open in Web Editor NEW
203.0 203.0 99.0 1.26 MB

:lollipop: A React Native Loader Component which uses Airbnb's Lottie for beautiful loader animations.

Home Page: https://medium.com/better-programming/how-to-create-a-beautifully-animated-loader-in-react-native-21da37a8f6b0

License: MIT License

JavaScript 100.00%
hacktoberfest loaders lottie lottie-animation lottie-animation-spinners react-native react-native-loader spinners

react-native-animated-loader's Introduction

react-native-animated-loader's People

Contributors

ankurk91 avatar brysonmk1984 avatar jackhedaya avatar ramprakashreddy avatar sudhirkumarojhaa avatar vannevelj avatar vikrantnegi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-animated-loader's Issues

Animation not playing fully through

I've created my own Lottie file which works as desired when tested on lottie files preview -https://lottiefiles.com/share/fpzibff0

But for some reason when I call it within my code it only plays part of the animation.

I read a few issues related to total size of the json file but mine is on 30kb

code

<AnimatedLoader
        visible={visible}
        overlayColor="rgba(255,255,255,0.75)"
        source={require("../../assets/logo_drop_loopout.json")}
        animationStyle={styles.lottie}
        speed={1.5}
        >
</AnimatedLoader>

Versions:

react-native: 0.63.2 
"lottie-ios": "3.1.8",
"lottie-react-native": "4.0.3",
"react-native-animated-loader": "^0.0.9",

desired full animation, where it spins 3 times after

full_anmiation.mov

vs partial animation

partial_animation1.mov

Any help appreciated.

TypeError: undefined is not an object (evaluating 'subscription[nativeEmitterSubscriptionKey]')

Hey Man, I started using your library and I am running have a strange issue. The thing is that I am ocassinally getting some strange error:

TypeError: undefined is not an object (evaluating 'subscription[nativeEmitterSubscriptionKey]')

This error is located at:
    in NavigationContainer (at App.js:280)
    in Provider (at App.js:279)
    in Provider (at App.js:278)
    in Provider (at App.js:277)
    in Provider (at App.js:276)
    in Provider (at App.js:275)
    in Provider (at App.js:274)
    in Provider (at App.js:273)
    in RCTView (at View.js:34)
    in View (created by MenuProvider)
    in RCTView (at View.js:34)
    in View (created by MenuProvider)
    in MenuProvider (at App.js:272)
    in Provider (at App.js:271)
    in Provider (at App.js:270)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at App.js:269)
    in _default (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in DevAppContainer (at AppContainer.js:121)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue

Would be great if you could look into this:

import React, { useEffect } from 'react';
import {
    StyleSheet,
    View,
    Text
} from 'react-native';
import AnimatedLoader from "react-native-animated-loader";

const Loader = ({ visible }) => {

    return (
        <View style={styles.container}>
            <AnimatedLoader
                visible={visible}
                overlayColor="rgba(255,255,255,0.75)"
                source={require("../../assets/loader-strange.json")}
                animationStyle={styles.lottie}
                speed={1}
            >
                {/* <Text>Doing something...</Text> */}
            </AnimatedLoader>
        </View>
    )
};

const styles = StyleSheet.create({
    lottie: {
        width: 100,
        height: 100
    }
});

export default Loader;

I am then using it on one of my screens:

import React, { useEffect, useState, useContext, useRef } from 'react'
import {
    Text,
    FlatList,
    View,
    StyleSheet,
    RefreshControl
} from 'react-native';
...
import Loader from '../../components/Loader';

const InteractionsScreen = ({ navigation }) => {

    return (
        <View style={styles.container}>
            ...
            <Loader visible={true} />
            ...
        </View>
    );
}

const styles = StyleSheet.create({
    ...
});

export default InteractionsScreen;

image

When loader is in screen, If I press back button,It doesn't work.

`
const RenderLoadingView = () => {
return (

<AnimatedLoader
visible={true}
overlayColor="rgba(0,0,0,0.75)"
source={require("./loading3.json")}
animationStyle={styles.lottie}
speed={1}
/>
);
};

const styles = StyleSheet.create({
lottie: {
width: 200,
height: 200
},
spinnerContainer: {
flex: 1,
marginTop:30,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F1F1F1',
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
},
});
export default RenderLoadingView;
`

/////////////////////////////////////////////////////////////////////////////////////////////////

render = () => { if (this.state.isVisible) return (<RenderLoadingView/>); return this.renderSahisPaydasIsletmeEkle(); }

I did a component. When ฤฑ call it , i works nicely. But if my operation take long time, I want press back button in android and Back function doesn't work.

Before this library, I use react-native-spinkit an I did press back button and it worked.
It was like this:

<Spinner isVisible={isVisible} type={type} size={size} />
Please Help Me :)

Animation not showing

I copied and pasted the usage example, and downloaded a loader from lottie files. The overlay shows up as expected, but the animation does not show on the screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.