All Projects → m1ga → Ti.animation

m1ga / Ti.animation

Licence: other
Airbnb Lottie Animation module for Axway Titanium SDK

Projects that are alternatives of or similar to Ti.animation

Lottie Windows
Lottie-Windows is a library (and related tools) for rendering Lottie animations on Windows 10.
Stars: ✭ 322 (+209.62%)
Mutual labels:  lottie
Lottie Editor
A tool to edit colors in Lottie animations.
Stars: ✭ 595 (+472.12%)
Mutual labels:  lottie
Vue Lottie
Render After Effects animations on Vue based on Bodymovin
Stars: ✭ 1,037 (+897.12%)
Mutual labels:  lottie
Zhumulangma
高仿喜马拉雅Android客户端,单activity多fragme组件化架构(新增ams版)
Stars: ✭ 377 (+262.5%)
Mutual labels:  lottie
Lottie Player
Lottie viewer/player as an easy to use web component! https://lottiefiles.com/web-player
Stars: ✭ 457 (+339.42%)
Mutual labels:  lottie
Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+6250.96%)
Mutual labels:  lottie
Lottieuwp
UWP port of Lottie(https://github.com/airbnb/lottie-android)
Stars: ✭ 276 (+165.38%)
Mutual labels:  lottie
Lottie React
A lightweight React library for rendering complex After Effects animations in real time using Lottie.
Stars: ✭ 83 (-20.19%)
Mutual labels:  lottie
Fluttie
Easily display stunning Lottie animations in flutter apps with this plugin.
Stars: ✭ 463 (+345.19%)
Mutual labels:  lottie
Lottiefy
Render Lottie to any engine
Stars: ✭ 43 (-58.65%)
Mutual labels:  lottie
Urweatherview
Show the weather effects onto view written in Swift4.2
Stars: ✭ 439 (+322.12%)
Mutual labels:  lottie
React Native Pull Refresh
Custom pull to refresh component for Android
Stars: ✭ 456 (+338.46%)
Mutual labels:  lottie
Lottie Android
Render After Effects animations natively on Android and iOS, Web, and React Native
Stars: ✭ 32,189 (+30850.96%)
Mutual labels:  lottie
React Native Messenger
Facebook Messenger Implementation using react-native
Stars: ✭ 351 (+237.5%)
Mutual labels:  lottie
Tap water
【声明:未发布前,勿使用,勿star,预计2020年11月底发布】Flutter tab_bar组件,支持中间带加号按钮的TabBar,支持Lottie动画。iTeaTime(技术清谈)团队出品。Highly customizable tabBar and tabBarController for Flutter
Stars: ✭ 52 (-50%)
Mutual labels:  lottie
Ng Lottie
Render After Effects animations on Angular based on lottie-web
Stars: ✭ 311 (+199.04%)
Mutual labels:  lottie
Materialdialog Android
📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily.
Stars: ✭ 602 (+478.85%)
Mutual labels:  lottie
Lottiesharp
Port of Lottie(https://github.com/airbnb/lottie-android)
Stars: ✭ 90 (-13.46%)
Mutual labels:  lottie
Lottiexamarin
Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
Stars: ✭ 1,085 (+943.27%)
Mutual labels:  lottie
Lottie Qml
QML Item for rendering Lottie Web animations in a QtQuick Canvas
Stars: ✭ 40 (-61.54%)
Mutual labels:  lottie

Ti.Animation

Buy Me A Coke donate button

gif

Appcelerator Titanium Android module to support smooth and scalable animations using Airbnb Lottie.

⚠️ The versions iOS 2.0.0 and Android 3.0.0 contain a breaking change that removed the Facebook Keyframes library. We decided to go with a Lottie only library for the future, since it made the race for the best animation library. Also, the deprecated method addViewToLayer is now removed. Please continue to use addViewToKeypathLayer.

Migrate from iOS < 2.0.0 and Android < 3.0.0

Instead of using createLottieView, simply use createAnimationView now. That's it!

Requirements

  • Axway Titanium SDK 7.0.0+
  • Axway Titanium SDK 9.0.0+ for Ti.Animation 4.0.0+

Library versions:

The Titanium modules use external libraries

Library Platform Version Build Date
Airbnb Lottie Android 3.5.0 2020/11/09
Airbnb Lottie iOS 2.5.2 2018/12/10

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
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) Android
setText(String layer, String text) Layer, Text Sets the text in the layer layer to text Android
addViewToKeypathLayer(TiUiView view, String layer) View, Layer Adds a given Ti.UI.View instance to a layer with the given name iOS
convertRectToKeypathLayer() args - iOS
convertPointToKeypathLayer() args - iOS
convertRectFromKeypathLayer() args - iOS
convertPointFromKeypathLayer() args - iOS
setValueDelegateForKeyPath() args - iOS

Properties:

Name Parameter Info Platforms
progress float Get/set the current progress (in percentage) Android
loop boolean Get/set if the animation should loop Android
speed float Get/set the speed of the animation Android
duration float Get/set the duration of the animation Android
isPlaying boolean Get the animation status Android
cache() boolean - 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) iOS, Android
loop boolean loop the animation iOS, Android
autoStart boolean automatically start the animation 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

iOS Constants

used in setValueDelegateForKeyPath.type

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

Patreon donate button

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].