rni
react-native-image-cache
npm i react-native-image-cache
rni

react-native-image-cache

Image caching for Android

by Anthony Ou

0.0.8 (see all)License:MITTypeScript:Not Found
npm i react-native-image-cache
Readme

Image caching for Android

This is still very basic since I am quite new to React. There is plenty of room for improvment by adding additional react bindings for props and callbacks.

Props:
PropertyTypeDefaultDescription
srcstringnullhttp source of the image
tintColorstringnulloptional tintColor

Include in your App

Installation

Install the npm package react-native-image-cache. Inside your React Native project, run (example):

npm install --save react-native-image-cache

In android/settings.gradle add the following lines

include :react-native-image-cache'
project(':react-native-image-cache').projectDir = file('../node_modules/react-native-image-cache/android')

NOTE : If you have included other libraries in your project, the include line will contain the other dependencies too.

In android/app/build.gradle, add a dependency to ':react-native-image-cache'

dependencies {
    compile project(':react-native-image-cache')
}

Next, you need to change the MainActivity of your app to register ReactImageCache :

import com.image.cache.ReactImageCache; // add this import

public class MainActivity extends ReactActivity {
    //...

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReactImageCache() // add this manager
      );
    }

TeamLockr image caching Team Lockr image caching for react native

These are functions created by the TeamLockr Team created for the TeamLockr platform.


Downloads/wk

0

GitHub Stars

12

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
0.0.8
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate