6.3.6 • Published 3 years ago

nativescript-image-cache-it v6.3.6

Weekly downloads
272
License
Apache-2.0
Repository
-
Last release
3 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

3 years ago

6.3.5

4 years ago

6.3.4

4 years ago

6.3.3

4 years ago

6.3.2

4 years ago

6.3.1

4 years ago

6.2.0

4 years ago

6.3.0

4 years ago

6.1.0

4 years ago

6.0.6

4 years ago

6.0.5

4 years ago

6.0.3

4 years ago

6.0.4

4 years ago

6.0.2

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.0.0-beta.20

4 years ago

5.0.0-beta.19

4 years ago

5.0.0-beta.18

4 years ago

5.0.0-beta.17

4 years ago

5.0.0-beta.16

4 years ago

5.0.0-beta.15

4 years ago

5.0.0-beta.14

4 years ago

5.0.0-beta.13

4 years ago

5.0.0-beta.12

4 years ago

5.0.0-beta.11

4 years ago

5.0.0-beta.10

4 years ago

5.0.0-beta.9

4 years ago

5.0.0-beta.8

4 years ago

5.0.0-beta.6

4 years ago

5.0.0-beta.4

4 years ago

5.0.0-beta.3

4 years ago

5.0.0-beta.2

4 years ago

5.0.0-beta.1

4 years ago

5.0.0-beta.0

4 years ago

5.0.0-alpha.23

4 years ago

5.0.0-alpha.22

4 years ago

5.0.0-alpha.21

4 years ago

5.0.0-alpha.20

5 years ago

5.0.0-alpha.19

5 years ago

5.0.0-alpha.18

5 years ago

5.0.0-alpha.17

5 years ago

5.0.0-alpha.16

5 years ago

5.0.0-alpha.15

5 years ago

5.0.0-alpha.14

5 years ago

5.0.0-alpha.13

5 years ago

5.0.0-alpha.12

5 years ago

5.0.0-alpha.11

5 years ago

5.0.0-alpha.10

5 years ago

5.0.0-alpha.9

5 years ago

5.0.0-alpha.8

5 years ago

5.0.0-alpha.7

5 years ago

5.0.0-alpha.6

5 years ago

5.0.0-alpha.5

5 years ago

5.0.0-alpha.4

5 years ago

5.0.0-alpha.3

5 years ago

5.0.0-alpha.2

5 years ago

5.0.0-alpha.1

5 years ago

5.0.0-alpha.0

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.9

6 years ago

4.0.8

6 years ago

4.0.7

6 years ago

4.0.6

6 years ago

4.0.5

6 years ago

4.0.4

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.6.0

7 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago