Skip to content

Commit 603d694

Browse files
Nicolas Nasodanielsogl
Nicolas Naso
authored andcommitted
feat(lottie-splash-screen): add new plugin (#2880)
* feat(lottie-splash-screen): added new plugin * Update index.ts
1 parent 3226f76 commit 603d694

File tree

1 file changed

+53
-0
lines changed
  • src/@ionic-native/plugins/lottie-splash-screen

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { Injectable } from '@angular/core';
2+
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
3+
4+
/**
5+
* @name Lottie Splash Screen
6+
* @description
7+
* Cordova plugin to show bodymovin/Lottie animations as the splash screen with Airbnb's Lottie wrapper
8+
*
9+
* @usage
10+
* ```typescript
11+
* import { LottieSplashScreen } from '@ionic-native/lottie-splash-screen';
12+
*
13+
*
14+
* constructor(private lottieSplashScreen: LottieSplashScreen) { }
15+
*
16+
* ...
17+
*
18+
*
19+
* this.lottieSplashScreen.show('www/lottie/animation.json', false, 1024, 768)
20+
* .then((res: any) => console.log(res))
21+
* .catch((error: any) => console.error(error));
22+
*
23+
* ```
24+
*/
25+
@Plugin({
26+
pluginName: 'LottieSplashScreen',
27+
plugin: 'cordova-plugin-lottie-splashscreen',
28+
pluginRef: 'lottie.splashscreen',
29+
repo: 'https://github.com/timbru31/cordova-plugin-lottie-splashscreen',
30+
install: '',
31+
installVariables: [],
32+
platforms: ['Android', 'iOS']
33+
})
34+
@Injectable()
35+
export class LottieSplashScreen extends IonicNativePlugin {
36+
/**
37+
* This function shows a Lottie splash screen. If no arguments are given, it defaults to the config.xml values, however you can pass (new) options here to change the behavior on runtime. (For easier reading the TypeScript notation is used)
38+
* @param location {string} Location of the Lottie JSON file that should be loaded.
39+
* @param remote {number} Toggles Lottie's remote mode which allows files to be downloaded/displayed from URLs. Example:
40+
* @param width {number} Width of the container that's rendering the Lottie animation
41+
* @param height {number} Height of the container that's rendering the Lottie animation
42+
*/
43+
@Cordova({
44+
sync: true
45+
})
46+
show(location?: string, remote?: boolean, width?: number, height?: number): void {}
47+
48+
/**
49+
* This methods hides the current active Lottie splashscreen and destroys the views.
50+
*/
51+
@Cordova({ sync: true })
52+
hide(): void {}
53+
}

0 commit comments

Comments
 (0)