• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    Objective-C
  • License
    Other
  • Created almost 8 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

Airbnb Lottie Animation module for Titanium

Ti.Animation

Titanium module to support smooth and scalable animations using Airbnb Lottie and Rive (Android only).

gif

Requirements

  • Android: Titanium SDK 9.0.0+
  • iOS: Titanium SDK 11.0.0+

Library versions:

The Titanium modules use external libraries

Library Platform Version
Airbnb Lottie Android 6.1.0
Airbnb Lottie iOS 4.1.2
Rive Android 4.3.2

Create a View

var animation = TiAnimation.createAnimationView({
  file: '/file.json',
  loop: false,
  autoStart: false
});

or in Alloy:

<AnimationView id='view_lottie' module='ti.animation' />

Update native Libraries

  • iOS: Use Carthage and carthage update to compile the framework automatically. Then, copy the output from ios/Carthage/Build/iOS to ios/platform/.
  • Android: change the version number in build.gradle

Features/Documentation

Methods

Name Parameter Info Platforms
start() Starts an animation from the beginning iOS, Android
start(int from, int to) Startframe, Endframe Plays an animation from frame from to to Android
start({string animationName, bool loop}) Plays the rive animation Android (Rive only)
pause() Pause an animation iOS, Android
resume() Resumes an animation from the current point iOS, Android
stop() Stops an animation an resets it iOS, Android
addEventListener(String event, Callback function) Event name as string
Callback function
Adds events to the animation view iOS, Android
setFile(String path) File path as string Sets the current animation, Files go into app/assets/ (Alloy) iOS, Android
setText(String layer, String text) Layer, Text Sets the text in the layer layer to text Android

Properties

Name Parameter Info Framework Platforms
progress float Get/set the current progress (in percentage) Lottie Android
loop boolean Get/set if the animation should loop Lottie Android
speed float Get/set the speed of the animation Lottie Android
duration float Get/set the duration of the animation Lottie Android
isPlaying boolean Get the animation status Lottie Android
cache() boolean - Lottie iOS
animationName String or Array Sets the Rive animation name Rive Android
newRenderingEngineEnabled boolean Use the core animation background rendering engine instead of the main thread Lottie iOS

creation (tss) only:

Name Parameter Info Platforms
assetFolder String If your animation contains images put the folder inside the assetFolder (e.g. images/ and put the image files inside app/assets/images/) Android
file String JSON file. Files go into app/assets/ (Alloy)
Android: Support for dotLottie files in 4.1.0+
iOS, Android
jsonString String Pass a raw JSON string to the module iOS
loop boolean loop the animation iOS, Android
autoStart boolean automatically start the animation iOS, Android
animationType int One of the constants ANIMATION_LOTTIE or ANIMATION_RIVE iOS, Android

Events

Name Info Properties Platforms
complete When the animation is done Status:int, Loop:boolean iOS, Android
update Fires during the animation Frame:int, status:int (ANIMATION_START, ANIMATION_END, ANIMATION_CANCEL, ANIMATION_REPEAT, ANIMATION_RUNNING) Android

Constants

Name Platforms
ANIMATION_RIVE Android
ANIMATION_LOTTIE Android

used in setValueDelegateForKeyPath.type (iOS):

Name Platforms
CALLBACK_COLOR_VALUE iOS
CALLBACK_NUMBER_VALUE iOS
CALLBACK_POINT_VALUE iOS
CALLBACK_SIZE_VALUE iOS
CALLBACK_PATH_VALUE iOS

Example

<AnimationView id='view_lottie' module='ti.animation' />
'#view_lottie': {
  file: 'data.json',
  assetFolder: 'images/', // Android-only
  width: Ti.UI.SIZE,
  height: Ti.UI.SIZE,
  borderColor: '#000',
  borderWidth: 1
}

Please see the basic example in example/app.js. More examples can found in the wiki

Issue

If you scale your view bigger and you have some jagged lines you need to add disableHardwareAcceleration:true to your tss file. Performance will be slower in most cases but quality is better

Resources

Authors

More Repositories

1

from_zero_to_app

πŸ“± Basic tutorials for Appcelerator Titanium. Create your first mobile app from start to finish!
46
star
2

ti.dfp

Doubleclick for Publishers (DFP) module for Titanium Mobile
Objective-C
22
star
3

ti.coronawidget

Appclerator Titanium Covid-19 widget for Android
JavaScript
16
star
4

com.miga.waterfall

Alloy Waterfall layout for images
JavaScript
14
star
5

card_swipe_demo

Axway Appcelerator swipe cards demo
JavaScript
12
star
6

ti.miga.sms.receive

Titanium Android module to receive SMS
Java
11
star
7

tifit

Titanium module for Android Fit
Java
11
star
8

ti-pdf-js

How to display a PDF file on Android using Titanium and pdf.js
Java
10
star
9

socket_io_demo

Basic socket.io chat app and a node.js socket server.
Objective-C
9
star
10

hyperloop.collapsingToolbarLayout

Axway Hyperloop example: Using native CollapsingToolbar Android XML layout
JavaScript
9
star
11

hyperloop.speech

Axway Hyperloop speech recognition and text-to-speech for Android
JavaScript
8
star
12

elementor_just_free

Just show free stuff in the Elementor
CSS
7
star
13

Ti.CalendarView

Axway Hyperloop Calendar View for Android
JavaScript
7
star
14

ti.blurview

Android BlurView module for Appcelerator Titanium
Java
7
star
15

ti.vonage

Vonage module for Appcelerator Titanium
Objective-C
7
star
16

hyperloop.bigimages

Axway Hyperloop example using SubsamplingScaleImageView on Android
JavaScript
6
star
17

appcelerator_turntable_animation

360Β° turntable animation with Axway Appcelerator
JavaScript
6
star
18

titanium_background_app

Keep a Titanium app running in background
JavaScript
6
star
19

ti.richedit

Makefile
6
star
20

ti.model_collection_example

Basic Appcelerator Titanium example using Models and Collections
JavaScript
6
star
21

ti.bottomNavView

Titanium Android module: Add a view to a BottomNavigation
Java
5
star
22

ti.inappupdate

Android in-app update for Appcelerator Titanium
Java
5
star
23

com.miga.downloadmanager

Use the Android DownloadManager in Titanium
Java
5
star
24

hyperloop.bluetooth

JavaScript
5
star
25

hyperloop.barcode

Axway Hyperloop barcode scanner for Android
JavaScript
5
star
26

ti.githubAction

Github action to build a Titanium app
JavaScript
5
star
27

ti.imagecrop

Titanium image crop for Android
Java
5
star
28

ti.appwrite

Titanium Android module for Appwrite.io
Java
5
star
29

ti.documentscanner

Android module for Appcelerator Titanium to scan and crop documents
Java
5
star
30

ti.rangebar

Java
4
star
31

ti.googlepay

ti.googlepay
Java
4
star
32

ti.osm

OpenStreetMap module for Appcelerator Titanium
Java
4
star
33

hyperloop.scratchView

Axway Hyperloop scratch view for Android
JavaScript
4
star
34

ti-crypt

Asymmetric Encryption with RSA (private/public key)
Java
4
star
35

ti.codescanner

Titanium module for the MLKit "Google code scanner" - Scan codes without any permission
Java
3
star
36

demo_app_holiday

JavaScript
3
star
37

ti.thermalprinter

ESC/POS thermal printer library for Titanium (Android)
Java
3
star
38

ti.popover

Java
3
star
39

ti.lines

Java
3
star
40

ti.webviewpdf

Java
2
star
41

hyperloop-smartGL

Hyperloop Test: Android smartGL View
JavaScript
2
star
42

wordguesser

Word guesser app for Appcelerator Titanium
JavaScript
2
star
43

ti.waveform

Display a waveform (amplitude) in Titanium
Java
2
star
44

com.miga.slideshow

Fullscreen background slideshow widget
JavaScript
2
star
45

ti.svg

Java
2
star
46

ti.flexbox

Java
2
star
47

ti.rootcheck

Swift
2
star
48

ti.ffmpeg

Titanium FFMPEG module for Android
Java
2
star
49

ti.bottomsheet

Java
2
star
50

hyperloop.youtube

Axway Hyperloop example: Android youtube player
JavaScript
2
star
51

hyperloop.audiorecorder

Axway Hyperloop audio recorder example for Android
JavaScript
2
star
52

ti.qrview

Java
2
star
53

elementor_breadcrumb

Simple breadcrumb component for Elementor
PHP
2
star
54

ti.sslcheck

C
2
star
55

titanium-install

1
star
56

ti.print

Android Print module for Titanium
Java
1
star
57

ti.calendar

Java
1
star
58

ti.nearby

Java
1
star
59

titanium-android-build

1
star
60

ti.exoplayer

Ti.Exoplayer - Audio/Video player for Android
Java
1
star
61

twitch_search_dashboard

Twitch Search Dashboard - Be the first viewer & say hi!
CSS
1
star
62

ifsc_results

IFSC Climbing results with nodejs
JavaScript
1
star
63

ti-wifidirect

Wi-Fi Peer-to-Peer Android Demo code converted to Titanium module *work-in-progress*
Java
1
star
64

ti.pagetransform

Java
1
star
65

timaxtex

Appcelerator Titanium Android module to get the GL_MAX_TEXTURE_SIZE value
Java
1
star
66

ti.soundpool

SoundPool plugin for Titanium
Java
1
star
67

hyperloop.webrtc

Appcelerator Titanium - Hyperloop WebRTC Android Demo
JavaScript
1
star
68

titanium-mlkit-demo

titanium-mlkit-demo
1
star
69

com.miga.imagesize

Returns the image size on android from a local image
Makefile
1
star
70

ti.googlefit

Java
1
star
71

hyperloop.parkedText

Axway Hyperloop example: ParkedText library
JavaScript
1
star
72

ti.zendesk

Java
1
star
73

ti.blurhash

Blurhash placeholder images for Titanium
Java
1
star
74

ti.viewanimation

Java
1
star