1.0.2 • Published 2 years ago

rn-weblineindia-image-cache v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

React Native - Image Cache Component

A React Native based component for Image Cache in your application.

Getting started

Demo

npm.io

Installation

$ npm install rn-weblineindia-image-cache --save

$ npm install react-native-fs --save

$ npm install md5

We have used react-native-fs to handle file system access in this package and it requires an extra step during the installation.

Use npm install md5 to handle file name store and access.

Supported versions

We have tested this component in ReactNative 0.60 - 0.66.4. You can still use it in other versions.

Usage

import ImageCacheComponent from 'rn-weblineindia-image-cache';

 <ImageCacheComponent
  sourceUrl={'imageURL'}
  resizeMode={'contain'}
  imageStyle={{ flex: 1 }}
  placeholderImage={require('thumbImage')}
  activityIndicatorSize={'small'}
  activityIndicatorColor={'red'}
  activityIndicatorStyle={{ justifyContent: 'center', alignItems: 'center' }}
  />

Here is a sample screen in which you can implement the image-cache Component

 <ImageCacheComponent
  sourceUrl={'imageURL'}
  resizeMode={'contain'}
  imageStyle={{ flex: 1 }}
  placeholderImage={require('../Image/test.png')}
  activityIndicatorSize={'small'}
  activityIndicatorColor={'red'}
  activityIndicatorStyle={{ justifyContent: 'center', alignItems: 'center' }}
  />

Props

PropsTypeRequiredDescription
sourceUrlstringyesURL for fetch photo
resizeModestringnocover,contain,stretch,repeat,center. Default contain
imageStyleobjectnoApply style for image, Default is flex:1
placeholderImagestringnoTo show default image when image has issue.Required local image path.
activityIndicatorSizestringnosmall,large, Default is small
activityIndicatorColorstringnoforeground color for indicator
activityIndicatorStylestringnoApply style for indicator, Default is center of element

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.


Changelog

Detailed changes for each release are documented in CHANGELOG.md.


License

MIT


Keywords

rn-weblineindia-image-cache, react-native-image-cache, image-cache, react-native, image-caching, react-image-caching