6.3.6 • Published 5 years ago

nativescript-image-cache-it v6.3.6

Weekly downloads
272
License
Apache-2.0
Repository
-
Last release
5 years ago

npm npm Build Status

Image-Cache-It

Glide - Android

SDWebImage - IOS

Install

NativeScript 6.5x

  • tns plugin add nativescript-image-cache-it

NativeScript 4x

  • tns plugin add nativescript-image-cache-it@5.0.0-beta.20

NativeScript 3x

  • tns plugin add nativescript-image-cache-it@3.0.7

NativeScript 2x

  • tns plugin add nativescript-image-cache-it@1.6.0

Usage

import { ImageCacheIt } from 'nativescript-image-cache-it';
// **new** call in your app.ts/ main.ts/ app.js to enable image-cache to hook into the device's lowmemory events
ImageCacheIt.enableAutoMM();

Set image url to load.

load = image;

Set placeholder while images are downloading.

placeHolder = '~/assets/images/ph.png';

Set placeholder for images are that failed to download.

errorHolder = '~/assets/images/broken.png';

Set decoded image size.

decodedWidth = '300';
decodedHeight = '300';

Stretch

stretch = "aspectFit" // (optional) aspectFit || aspectFill || fill || none

Prefetch

import { ImageCacheIt } from 'nativescript-image-cache-it';
ImageCacheIt.fetchItem('https://source.unsplash.com/random').then(imageUrl =>{}).catch();

Delete item from cache

import { ImageCacheIt } from 'nativescript-image-cache-it';
ImageCacheIt.deleteItem('https://source.unsplash.com/random').then().catch();

Get item from cache

import { ImageCacheIt } from 'nativescript-image-cache-it';
ImageCacheIt.getItem('https://source.unsplash.com/random').then(imageUrl =>{}).catch();

e.g

import { ImageCacheIt } from 'nativescript-image-cache-it';
let cache = new ImageCacheIt();
cache.src = image;
cache.placeHolder = '~/assets/images/broken.png';
cache.errorHolder = '~/assets/images/ph.png';
cache.decodedWidth = '300';
cache.decodedHeight = '300';
cache.filter = 'blur(10px);';
cache.stretch = 'aspectFit';
return cache;

Xml markup settings

decodedWidth="300"; <!-- (optional) -->
decodedHeight="300"; <!-- (optional) -->
placeHolder="~/assets/images/ph.png" <!-- (optional) -->
errorHolder="~/assets/images/broken.png"  <!-- (optional) -->
stretch = "aspectFit" <!-- (optional) -->
src= "http://screenrant.com/wp-content/uploads/The-Flash-vs-the-Reverse-Flash.jpg" <!-- (required) -->

IMPORTANT: Make sure you include xmlns:i="nativescript-image-cache-it" on the Page element

e.g

<i:ImageCacheIt stretch="aspectFit"  resize="300,300" placeHolder="~/assets/images/ph.png" errorHolder="~/assets/images/broken.png" src="http://screenrant.com/wp-content/uploads/The-Flash-vs-the-Reverse-Flash.jpg"/>

Angular

import { TNSImageCacheItModule } from 'nativescript-image-cache-it/angular';

@NgModule({
    imports: [
    TNSImageCacheItModule
    ],
    declarations: [
        AppComponent
    ],
    bootstrap: [AppComponent]
})

Screenshots

Repeater

ImageImageCacheIt
image_repeaterimagecacheit_repeater

ListView

ImageImageCacheIt
image_listviewimagecacheit_listview
6.3.6

5 years ago

6.3.5

5 years ago

6.3.4

5 years ago

6.3.3

5 years ago

6.3.2

5 years ago

6.3.1

5 years ago

6.2.0

5 years ago

6.3.0

5 years ago

6.1.0

5 years ago

6.0.6

5 years ago

6.0.5

5 years ago

6.0.3

5 years ago

6.0.4

5 years ago

6.0.2

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.0-beta.20

6 years ago

5.0.0-beta.19

6 years ago

5.0.0-beta.18

6 years ago

5.0.0-beta.17

6 years ago

5.0.0-beta.16

6 years ago

5.0.0-beta.15

6 years ago

5.0.0-beta.14

6 years ago

5.0.0-beta.13

6 years ago

5.0.0-beta.12

6 years ago

5.0.0-beta.11

6 years ago

5.0.0-beta.10

6 years ago

5.0.0-beta.9

6 years ago

5.0.0-beta.8

6 years ago

5.0.0-beta.6

6 years ago

5.0.0-beta.4

6 years ago

5.0.0-beta.3

6 years ago

5.0.0-beta.2

6 years ago

5.0.0-beta.1

6 years ago

5.0.0-beta.0

6 years ago

5.0.0-alpha.23

6 years ago

5.0.0-alpha.22

6 years ago

5.0.0-alpha.21

6 years ago

5.0.0-alpha.20

6 years ago

5.0.0-alpha.19

6 years ago

5.0.0-alpha.18

6 years ago

5.0.0-alpha.17

6 years ago

5.0.0-alpha.16

6 years ago

5.0.0-alpha.15

6 years ago

5.0.0-alpha.14

6 years ago

5.0.0-alpha.13

6 years ago

5.0.0-alpha.12

6 years ago

5.0.0-alpha.11

6 years ago

5.0.0-alpha.10

6 years ago

5.0.0-alpha.9

6 years ago

5.0.0-alpha.8

6 years ago

5.0.0-alpha.7

6 years ago

5.0.0-alpha.6

6 years ago

5.0.0-alpha.5

6 years ago

5.0.0-alpha.4

6 years ago

5.0.0-alpha.3

6 years ago

5.0.0-alpha.2

6 years ago

5.0.0-alpha.1

6 years ago

5.0.0-alpha.0

6 years ago

4.1.2

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.9

7 years ago

4.0.8

7 years ago

4.0.7

7 years ago

4.0.6

7 years ago

4.0.5

7 years ago

4.0.4

8 years ago

4.0.3

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.0.7

8 years ago

3.0.6

8 years ago

3.0.5

8 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.6.0

9 years ago

1.5.1

9 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago