Lottie Splash Screen
Cordova plugin to show bodymovin/Lottie animations as the splash screen with Airbnb's Lottie wrapper
Repo: https://github.com/timbru31/cordova-plugin-lottie-splashscreen
Installation
- Install the Cordova and Ionic Native plugins:
$ '' $ npm install --save @ionic-native/lottie-splash-screen@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { LottieSplashScreen } from '@ionic-native/lottie-splash-screen';
constructor(private lottieSplashScreen: LottieSplashScreen) { }
...
this.lottieSplashScreen.show('www/lottie/animation.json', false, 1024, 768)
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
Instance Members
show(location, remote, width, height)
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)
Param | Type | Details |
---|---|---|
location |
string
|
Location of the Lottie JSON file that should be loaded. |
remote |
number
|
Toggles Lottie's remote mode which allows files to be downloaded/displayed from URLs. Example: |
width |
number
|
Width of the container that's rendering the Lottie animation |
height |
number
|
Height of the container that's rendering the Lottie animation |
hide()
This methods hides the current active Lottie splashscreen and destroys the views.