Giter Site home page Giter Site logo

react-native-flanimatedimage's Introduction

react-native-flanimatedimage

FLAnimatedImage for React Native

This module is modified from https://github.com/browniefed/react-native-flanimatedimage with the following changes:

  • use Carthage or CocoaPods for FLAnimatedImage dependency
  • async image loading
  • return the image size onLoadEnd

Install

You have to install FLAnimatedImage first via Carthage or If you're using CocoaPods, you can put the following in your Podfile:

pod 'FLAnimatedImage'

then

npm install react-native-flanimatedimage --save

If you are using [email protected] or below

npm install [email protected] --save

Link

In XCode, in the project navigator:

  • Right click Libraries
  • Add Files to [your project's name]
  • Go to node_modules/react-native-flanimatedimage/RNFLAnimatedImage
  • Add the .xcodeproj file

In XCode, in the project navigator, select your project.

  • Add the libRNFLAnimatedImage.a from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries

If your Catrhage/Pods folder is not under ios folder, please modify the Headers Search Paths in Build Settings - Search Paths - Header Search Paths

  • Click .xcodeproj file you added before in the project navigator and go the Build Settings tab. Make sure All is toggled on (instead of Basic).
  • Look for Header Search Paths and add the path where the FLAnimatedImage's header files are placed.

Usage

import FLAnimatedImage from 'react-native-flanimatedimage';

...
  onLoadEnd = (e) => {
    if (!e.nativeEvent.size) return;
    const { width, height } = e.nativeEvent.size;
    this.setState({
      width,
      height,
    });
  }
...
  <FLAnimatedImage style={style} source={source} onLoadEnd={this.onLoadEnd} />
...

react-native-flanimatedimage's People

Contributors

gabrielbull avatar iancanderson avatar mgiachetti avatar nihgwu avatar poberwong avatar srandazzo 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

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-flanimatedimage's Issues

My gif is in slow motion,

Effectively the memory is not affected when I use this library, but the gif duration is 4 seconds and is seen in slow motion

FLAnimatedImage.h not found

I had some issues submitting my build to the app store with Carthage, so I decided to give the pod install a shot. Now the FLAnimatedImage.h is throwing an error in RNFLAnimatedImage.h. Any suggestions?

Gifs not running at full speed

First off,
This fixed my crash bug with loading large gifs all at the start of my app, so thanks for making this. It seems my animations are running at a lower frame rate than what they are when viewed on a computer or when they are just in an <Image/> tag. Is there a way to tweak the playback speed?

onLoadEnd not called?

Hey — Thanks for your work! Everything works great, but onLoadEnd does not fire for me... no idea why. I've implemented it exactly as described in the readme. Any ideas?

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000000c

Wondering if anyone else is seeing crashes in deployed apps that come up as "__32-[RNFLAnimatedImage reloadImage]_block_invoke_2"

We seem to be getting a few and just wondering if there is any common knowledge that I might be missing?

Cheers

Local File?

Hey @nihgwu! I finally got this working in my project! I had a problem in the beginning loading #import "RCTImageUtils.h" into it, and with you being so kind to add this package I knew it was something enough tinkering could figure out!

I have run into a roadblock however. Whenever I try to load a local file with the require method it seems to get a weird error of trying to convert the src of the file to JSON.

<FLAnimatedImage 
    style={styles.slideImage}
    src={require('../img/test.gif')}
    resizeMode="contain"/>

Have you tried loading any files locally?

Xcode error when running app

Hi there, I get the following Error after installing and running my app.

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FLAnimatedImage", referenced from: objc-class-ref in libRNFLAnimatedImage.a(RNFLAnimatedImage.o) "_OBJC_CLASS_$_FLAnimatedImageView", referenced from: objc-class-ref in libRNFLAnimatedImage.a(RNFLAnimatedImage.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

any ideas?

Issue with Xcode 9

Hi there, it appears this particular dependancy is unsupported on Xcode 9. It would be great if this could be addressed as I would imagine it's causing issues on a lot of plugins that rely on your great work. Thanks :)

Prevent GIF Looping

Hi,

Is it possible to prevent looping?

When I open my animated gifs in the browser (Chrome, Safari), it doesn't loop. But on ios (simulator included) and android devices my gifs are playing forever.

Thanks

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.