• Stars
    star
    108
  • Rank 320,329 (Top 7 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฃ ๐ŸŽฌ ๐Ÿ“ฑ Apache Cordova plugin to show Lottie animations as the splash screen with Airbnb's Lottie wrapper

cordova-plugin-lottie-splashscreen

Run a security audit Linting Smoke test on Ubuntu (Apache Cordova) Smoke test on Ubuntu (Ionic) Smoke test on macOS Smoke test on Windows

dependency Status Known Vulnerabilities

Commitizen friendly License npm

Apache Cordova plugin to show bodymovin/Lottie animations as the splash screen with Airbnb's Lottie wrapper

Supported platforms

  • iOS (11+) (with cordova-ios >= 5.0.0 only)
  • Android (with cordova-android >= 10.0.0 only)

Planned platforms

  • macOS (currently on hold until cordova-osx has a better Swift and CocoaPods support or cordova-ios gains Catalyst support)

Prerequisites/Warnings

iOS

You need to have CocoaPods installed because lottie-ios is fetched from there.

$ sudo gem install cocoapods
$ pod setup
Caveats

Only cordova >= 9.0.0 and cordova-ios >= 5.0.0 are supported.
You need to specify a valid SwiftVersion (minimum is 5.5) in your config.xml. (see https://cordova.apache.org/docs/en/latest/config_ref/)

Android

AndroidX and Kotlin support is required. Therefore only cordova-android >= 9.0.0 is supported.
If you use cordova-android <10.0.0 then you need to enable Kotlin and AndroidX in your config.xml by setting GradlePluginKotlinEnabled and AndroidXEnabled to true.
In the FAQ are some examples with common error messages and how to fix them.

Installation

from npm (recommended)

$ cordova plugin add cordova-plugin-lottie-splashscreen

from git (unstable)

$ cordova plugin add https://github.com/timbru31/cordova-plugin-lottie-splashscreen.git

Usage

This Apache Cordova plugin is meant as a replacement for the stock cordova-plugin-splashscreen.
An example project can be found in the example folder.

Methods

  • lottie.splashscreen.hide
  • lottie.splashscreen.show
  • lottie.splashscreen.on
  • lottie.splashscreen.once
lottie.splashscreen.hide

This methods hides the current active Lottie splashscreen and destroys the views. Returns a Promise which is resolved with "OK" in the success case or the error message when it's failed.

await lottie.splashscreen.hide();
lottie.splashscreen.show

This method 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. Returns a Promise which is resolved with "OK" in the success case or the error message when it's failed. (For easier reading the TypeScript notation is used)

await lottie.splashscreen.show(location?: string, remote?: boolean, width?: number, height?: number)
lottie.splashscreen.on

This method listens to custom lottie events that are dispatched from the native side and invokes a configured callback function. If the event parameter is a falsy value, such as null or "", the method will listen to all Lottie events. (For easier reading the TypeScript notation is used)

type LottieEvent = 'lottieAnimationStart' | 'lottieAnimationEnd' | 'lottieAnimationCancel' | 'lottieAnimationRepeat';

lottie.splashscreen.on(event: LottieEvent, callback: (ev: Event) => void);
lottie.splashscreen.once

This method listens to a custom lottie event once and resolves the Promise once the event has been called. (For easier reading the TypeScript notation is used)

type LottieEvent = 'lottieAnimationStart' | 'lottieAnimationEnd' | 'lottieAnimationCancel' | 'lottieAnimationRepeat';

await lottie.splashscreen.once(event: LottieEvent).then(event => console.log(event));

Preferences

  • LottieRemoteEnabled (Boolean, default false). Toggles Lottie's remote mode which allows files to be downloaded/displayed from URLs. Example:
    <preference name="LottieRemoteEnabled" value="true" />
  • LottieAnimationLocationLight (String, default ""). Location of the Lottie JSON file that should be loaded in light mode. Can either be a URL (if LottieRemoteEnabled is true) or a local JSON or ZIP file (e.g. www/lottie/error.json).
    <preference name="LottieAnimationLocationLight" value="https://assets.lottiefiles.com/datafiles/99nA1a7mkSF3Oz8/data.json" />
  • LottieAnimationLocationDark (String, default ""). Location of the Lottie JSON file that should be loaded in dark mode. Can either be a URL (if LottieRemoteEnabled is true) or a local JSON or ZIP file (e.g. www/lottie/error.json).
    <preference name="LottieAnimationLocationDark" value="https://assets.lottiefiles.com/datafiles/99nA1a7mkSF3Oz8/data.json" />
  • LottieAnimationLocation (String, default ""). Location of the Lottie JSON file that should be loaded as a fallback if there are no dark or light mode animations defined or if one of them is an invalid location. Can either be a URL (if LottieRemoteEnabled is true) or a local JSON or ZIP file (e.g. www/lottie/error.json).
    <preference name="LottieAnimationLocation" value="https://assets.lottiefiles.com/datafiles/99nA1a7mkSF3Oz8/data.json" />
  • LottieImagesLocation (String, default path of LottieAnimationLocation). Android only! Location of the Lottie images folder specified by the JSON.
    <preference name="LottieImagesLocation" value="www/lottie/images" />
  • LottieCancelOnTap (Boolean, default false). Immediately cancels the Lottie animation when the user taps on the screen.
    <preference name="LottieCancelOnTap" value="true" />
  • LottieHideTimeout (Double for iOS and Integer for Android, default 0). Duration after which the Lottie animation should be hidden. CAUTION: iOS reads this value in SECONDS, but e.g., 0.5 is supported. Android reads this value in MILLISECONDS!
    <preference name="LottieHideTimeout" value="?" /> <!-- CAUTION: iOS reads this value in **SECONDS**, Android reads this value in **MILLISECONDS**>
  • LottieBackgroundColorLight (String, default #ffffff). Background color of the overlay in light. Can be used with alpha values, too. (For more information see the 8 digits notation of RGB notation)
    <preference name="LottieBackgroundColorLight" value="#fff000a3" />
  • LottieBackgroundColorDark (String, default #ffffff). Background color of the overlay in dark mode. Can be used with alpha values, too. (For more information see the 8 digits notation of RGB notation)
    <preference name="LottieBackgroundColorDark" value="#fff000a3" />
  • LottieBackgroundColor (String, default #ffffff). Background color of the overlay as a fallback if there are no dark or light mode colors defined. Can be used with alpha values, too. (For more information see the 8 digits notation of RGB notation)
    <preference name="LottieBackgroundColor" value="#fff000a3" />
  • LottieWidth (Integer, default 200). Width of the container that's rendering the Lottie animation
    <preference name="LottieWidth" value="750" />
  • LottieHeight (Integer, default 200). Height of the container that's rendering the Lottie animation
    <preference name="LottieHeight" value="750" />
  • LottieRelativeSize (Boolean, default false). Uses width and height values as relative values. Specify them as e.g. 0.3 to have 30%.
    <preference name="LottieRelativeSize" value="true" />
  • LottieFullScreen (Boolean, default false). Renders the animation in full screen. Ignores properties above.
    <preference name="LottieFullScreen" value="true" />
  • LottieLoopAnimation (Boolean, default false). Loops the animation
    <preference name="LottieLoopAnimation" value="true" />
  • LottieAutoHideSplashScreen (Boolean, default false). Hides the Lottie splash screen when the pageDidLoad event fired
    <preference name="LottieAutoHideSplashScreen" value="true" />
  • LottieEnableHardwareAcceleration (Boolean, default false). Android only! Enables hardware acceleration for the animation view. Not really recommended since Lottie decides automatically whether the hardware mode should be used or not.
    <preference name="LottieEnableHardwareAcceleration" value="true" />
    <preference name="LottieScaleType" value="CENTER_CROP" />
  • LottieFadeOutDuration (Double for iOS and Integer for Android, default 0). Duration for the fade out animation. CAUTION: iOS reads this value in SECONDS, but e.g., 0.5 is supported. Android reads this value in MILLISECONDS! the Set to 0 disable the fade out animation.
    <preference name="LottieFadeOutDuration" value="?" /> <!-- CAUTION: iOS reads this value in **SECONDS**, Android reads this value in **MILLISECONDS**>
  • LottieHideAfterAnimationEnd (Boolean, default false). Hides the Lottie splash screen after the animation has been played. Do not use together with LottieAutoHideSplashScreen or LottieLoopAnimation
    <preference name="LottieHideAfterAnimationEnd" value="true" />
  • LottieCacheDisabled (Boolean, default false). Disables caching of animations.
    <preference name="LottieCacheDisabled" value="true" />

Built by (c) Tim Brust and contributors. Released under the MIT license.

More Repositories

1

SilkSpawners

โ› ๐Ÿท ๐Ÿ‘พ SilkSpawners plugin for CraftBukkit/Spigot
Java
75
star
2

quickjira

๐Ÿšค ๐Ÿ“‚ Quickly access the JIRA of your choice by typing the ticket id
JavaScript
73
star
3

docker-java-node

๐Ÿณ OpenJDK JRE or JDK (8,11 or 17) with Node.js 14 LTS (Fermium) or 16 LTS (Gallium) Docker image
Dockerfile
64
star
4

amazon-tag-remover

๐Ÿšซ ๐Ÿ’น ๐Ÿ›’WebExtension for Chrome, Firefox, Edge and Opera to remove the Amazon affiliate tracking ID (tag) from amazon links
TypeScript
58
star
5

docker-ruby-node

๐Ÿณ Ruby 2.7, 3.0 or 3.1 with Node.js 14 LTS (Fermium), Node.js 16 LTS (Gallium) or Node.js 18 LTS (Hydrogen) Docker image
Dockerfile
57
star
6

docker-node-alpine-git

๐Ÿณ Node.js 14 LTS (Fermium) or Node.js 16 LTS (Gallium) and Git Docker image
Dockerfile
40
star
7

docker-node-chrome

๐Ÿณ Node.js Node.js 14 LTS (Fermium), Node.js LTS 16 (Gallium) or Node.js LTS 18 (Hydrogen) and Chrom(e|ium) stable Docker image
Dockerfile
27
star
8

mms-stockshock

Your friendly ๐Ÿค– to check the wishlist and categories of MediaMarkt and Saturn for available items
TypeScript
20
star
9

masters-thesis

๐Ÿ“š โœ๏ธ ๐Ÿ•ต๐Ÿปโ€โ™‚๏ธ ๐Ÿšจ ๐Ÿ” Security Evaluation of Multi-Factor Authentication in Comparison with the Web Authentication API | Master's Thesis
HTML
12
star
10

PasswordProtect

๐Ÿ” PasswordProtect plugin for CraftBukkit/Spigot
Java
11
star
11

spigot-anti-piracy-backend

๐Ÿ‘ฎ ๐Ÿš” ๐Ÿšซ A simple koa.js backend to blacklisted leaked plugins via their user id or nonce
TypeScript
11
star
12

cordova-plugin-android-dark-mode-support

๐ŸŒš/๐ŸŒž Apache Cordova plugin to enable proper dark mode support for Android WebView's
Kotlin
10
star
13

mp3lyrics

๐ŸŽต ๐Ÿ“ CLI for mp3 lyrics fetching. Uses ruby-mp3info and some lyric wikis
Ruby
8
star
14

docker-alpine-java-maven

๐Ÿณ Alpine with Eclipse Temurin OpenJDK 11 and Maven Docker image
Dockerfile
7
star
15

PickupArrows

๐Ÿน โฌ†๏ธ PickupArrows plugin for CraftBukkit/Spigot
Java
7
star
16

UnlimitedLava

๐ŸŒ‹ ๐Ÿ”ถ ๐Ÿ” UnlimitedLava plugin for CraftBukkit/Spigot
Java
6
star
17

docker-node-alpine-firefox

๐Ÿณ Node.js 18 LTS (Hydrogen) and Firefox stable Docker image
Dockerfile
6
star
18

apple-developer-learnings

๐Ÿ ๐Ÿ“ฑ ๐Ÿ‘จโ€๐Ÿ’ป Publishing an App is hard. Understanding the Apple Developer ecosystem is even harder. This is a collection of learnings, me and my colleagues did the hard way. ๐Ÿ˜ฃ
5
star
19

cordova-plugin-delete-launch-screen-cache

๐Ÿงน๐ŸŒ… Apache Cordova plugin to programmatically delete the iOS launch screen cache on iOS 13+
Swift
5
star
20

cordova-plugin-detect-webview-engine

๐Ÿ…ฐ๏ธ โ‰๏ธ ๐Ÿ…ฑ๏ธ Apache Cordova plugin to determine whether the application is using UIWebView or WKWebView engine
JavaScript
5
star
21

ColorMe

ColorMe plugin for CraftBukkit/Minecraft
Java
5
star
22

ImmortalLogin

๐Ÿ’ฃ ๐Ÿ’ช ๐Ÿ›ก ImmortalLogin plugin for CraftBukkit/Spigot
Java
4
star
23

bukkit-kotlin-demo

๐Ÿ›  ๐Ÿšง small Kotlin demo plugin for Bukkit
Kotlin
3
star
24

CookMe

๐Ÿ”ฅ ๐Ÿ– ๐Ÿฅ“ CookMe plugin for CraftBukkit/Spigot
Java
3
star
25

cordova-plugin-android-device-information

๐Ÿ•ต๏ธโ€โ™‚๏ธ Apache Cordova plugin to get specific Android device information
Kotlin
3
star
26

spigot-anti-piracy-csv-exporter

๐Ÿ”Ž ๐Ÿ“ˆ ๐Ÿ“Š A helper utility to generate a csv export for the spigot-anti-piracy-backend
TypeScript
2
star
27

SilkSpawnersEcoAddon

๐Ÿ’ฑ ๐Ÿ‘พ CraftBukkit/Spigot plugin to charge the player when a spawner is changed.
Java
2
star
28

SilkSpawnersShopAddon

๐Ÿ’ฐ ๐Ÿ‘พ A sign shop addon for SilkSpawners [premium]
Java
1
star
29

S2-XML-Log

format mah looogs!
Python
1
star
30

SuperWheat

๐ŸŒฑ ๐Ÿ’ง ๐ŸŒพ SuperWheat plugin for CraftBukkit/Spigot
Java
1
star
31

bukkit-plugin-parent-pom

๐Ÿ“™ ๐Ÿ“ฆ Maven parent POM containing the default configuration to build Bukkit plugins
1
star
32

sad-creeper

๐Ÿค–๐Ÿ‘ฎโ€โ™€๏ธ - A Probot app to check for a valid server version output in newly created issues.
TypeScript
1
star
33

TimeTracker

โŒš๏ธ ๐Ÿ•‘ ๐Ÿ“… TimeTracker plugin for CraftBukkit/Spigot
Java
1
star