airbnb / lottie-android Goto Github PK
View Code? Open in Web Editor NEWRender After Effects animations natively on Android and iOS, Web, and React Native
Home Page: http://airbnb.io/lottie/
License: Apache License 2.0
Render After Effects animations natively on Android and iOS, Web, and React Native
Home Page: http://airbnb.io/lottie/
License: Apache License 2.0
Hi Guys,
I'm getting two different out comes when i export. The web one works fine but once i copy the json code into a android project the top corner becomes rounded. Before it was completely disconnected.
Also here is a gif of the android render
Thanks
my animator need to operate some .png img ,build a new folder "images" and put .png file in it .
json like this:"
{
"assets": [
{
"id": "image_0",
"w": 200,
"h": 120,
"u": "images/",
"p": "img_0.png"
}
],
...
} "
but I has run app ,can't see anything without empty
Before opening a new issue:
If this is a bug:
If this is a feature request:
JSON is 1.5 MB uncompressed, 94 KB zipped.
Lottie should probably switch from JSON to Flatbuffers. I'll open a separate issue for that.
I have a crash when loading an animation I put in the assets folder of the sample app.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.airbnb.lottie.AnimatableIntegerValue.(AnimatableIntegerValue.java:17)
at com.airbnb.lottie.Layer.fromJson(Layer.java:81)
at com.airbnb.lottie.LottieComposition.fromJsonSync(LottieComposition.java:165)
at com.airbnb.lottie.LottieComposition.fromInputStream(LottieComposition.java:102)
at com.airbnb.lottie.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:270)
at com.airbnb.lottie.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:258)
Actually i am wonder if is possible for the near future to implement support for minSdkVersion 15.
Thanks a lot!
https://github.com/blog/2111-issue-and-pull-request-templates
This will make sure that important information is not missed in an issue.
Points in issue template
Actual
Behaviour
Expected Behaviour
Steps to reproduce it
LogCat for the issue
Screenshots of the issue
Would you like to work on the issue?
@gpeal Any views on this?
Very similar to https://github.com/facebookincubator/Keyframes, at least you should explain why do we need a new project? What is it that you are improving?
Trim path start and end works.
But trim path offset does not yet.
I cant up bodymovin in AE CS6. :/
See: airbnb/lottie-ios#22
As lottie is using only subset of bodymovin features, it'll be a good idea to have script that minifies animation JSON file by dropping unused parts
Is it possible to use included sample animations in my google play app (not released yet)?
I tried Lottie sample app and in my own app as well. Once we open activity/fragment with LottieAnimationView and exit that activity, the memory is still allocated. I used android studio memory monitor tool to get memory footprint of the app.
Ideally it should free up the memory if that Animation is not used anymore.
Here is my screenshot showing memory allocation before opening Typographic activity, after opening it and after quitting it.
Currently, Lottie searches for "k" as a direct child of "p". However, in some cases, After Effects animations will have separated keyframes for x and y, resulting in a structure like this:
"p": {
"x": {
"k": {
}
}
"y": {
"k": {
}
}
}
LottieComposition will throw an IllegalArgumentException with the message "Point values have no keyframes", when trying to load the above JSON.
It would be nice if Lottie could support this structure as it seems to be a common approach to use.
Fixing this will also require changes further down the chain, as JsonUtils.pointFromJsonArray will throw an exception as well as it expects at least two values, but the point may now be 1-dimensional and therefore only contain one value.
Let me know, what your thoughts on this are - I might try to fix this myself, but won't waste time on it, if you are already aware of this limitation and are already working on it f.x..
I am a Xamarin programmer and whether can Lottie run in Xamarin ?
i have this error :
Error:Could not determine the dependencies of task ':LottieSample:transformClassesWithInstantRunForDebug'.
In order to use Instant Run with this device running API 17, you must install platform 17 in your SDK
Android Studio 2.1.3
Ubuntu 14.04
i just change buildToolsVersion from 25.0.2 to 25.0.0 , and doesn't change anything from root project .
thanks in advance
Repo: https://github.com/bradmartin/nativescript-lottie
Would be nice to have this on the README so devs know it is supported on another framework for mobile development. Thanks. Was fun working with 👍
Hi Gabriel,
Any chance of getting downsaved versions of the After Effects samples? I can't open them in AE CC15.
Lottie looks great BTW. It'll be really useful for me once I figure out how to embed vectors rather than have them included as linked files.
Thanks!
Ç
to see how it animate. But it crashed with a logcatCaused by: java.io.FileNotFoundException: Mobilo/Ç.json at android.content.res.AssetManager.openAsset(Native Method) at android.content.res.AssetManager.open(AssetManager.java:363) at android.content.res.AssetManager.open(AssetManager.java:337) at com.airbnb.lottie.LottieComposition.fromAssetFileName(LottieComposition.java:50) at com.airbnb.lottie.samples.LottieFontViewGroup.onKeyUp(LottieFontViewGroup.java:188)
When I debug, character Ç
and C
have the same keycode which is 31
. Solution to this?
A-Z
in French, English
. However, it doesn't work in Vietnamese
language when it is given A-Z
characters. Any clues?Thanks
Before opening a new issue:
If this is a bug:
If this is a feature request:
As seen so far,
there is no license specified,
so if I have this to be used in my projects which may be used commercial,
does Bodymovin come under Gnu or open source license or how
Will there be any legal issues forward?
Hi!
I just tried Lottie and I could make LottieAnimationView
work with no problems.
However, I cannot make LottieDrawable
work, and I wonder what I am doing wrong.
Here is what I do:
LottieDrawable lottieDrawable = new LottieDrawable();
mMainBinding.imgLottie.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mMainBinding.imgLottie.setImageDrawable(lottieDrawable);
LottieComposition.fromAssetFileName(this, "TwitterHeart.json", (composition) -> {
lottieDrawable.setComposition(composition);
lottieDrawable.loop(true);
lottieDrawable.playAnimation();
});
The result is I only see the first frame - the animation doesn't start.
I looked at the source of LottieAnimationView
to compare, and didn't see any major difference.
Any idea?
Lottie uses appcompat library version 25.1.1
https://github.com/airbnb/lottie-android/blob/master/lottie/build.gradle#L24
I'm using 24.1.1 version of support library. When adding lottie dependency, android studio changes my app support library version to the latest version used by any dependencies which here is 25.1.1
I'm not moving to 25.1.1 due to certain bugs in that version. It would be better if lottie uses lowest possible version of support library. For ex if it uses 23.x, and the user uses 24.x or 25.x, then on build time everyones support library version would be the maximum version used (24.x or 25.x).
FATAL EXCEPTION: AsyncTask #4
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
Caused by: java.lang.NullPointerException
at com.airbnb.lottie.animatable.AnimatableIntegerValue.<init>(AnimatableIntegerValue.java:27)
at com.airbnb.lottie.model.ShapeTransform.<init>(ShapeTransform.java:77)
at com.airbnb.lottie.model.ShapeGroup.shapeItemWithJson(ShapeGroup.java:37)
at com.airbnb.lottie.model.ShapeGroup.<init>(ShapeGroup.java:84)
at com.airbnb.lottie.model.ShapeGroup.shapeItemWithJson(ShapeGroup.java:31)
at com.airbnb.lottie.model.Layer.fromJson(Layer.java:165)
at com.airbnb.lottie.model.LottieComposition.fromJsonSync(LottieComposition.java:145)
at com.airbnb.lottie.model.LottieComposition.fromInputStream(LottieComposition.java:97)
at com.airbnb.lottie.model.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:266)
at com.airbnb.lottie.model.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:254)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
Ideally there would be 2 (or n) optional json parsing modules.
1 would use raw json objects so there would be no transitive dependencies
The other would use jackson or another more performant json parsing library.
I have encountered with an special case that involves multiple AsyncTasks running in a Context, where the fact that the Composition Loader is running in the basic AsyncTask Executor is causing problems with the task execution order.
I don't know if there's a reason, on why the loader task are executed this way, but it would be great to take a look on this.
The LottieSample
app is not being compiled by the Studio, for some reason it asks to setup a Gradle plugin, after which it keeps showing the building dialog box indefinitely.
The same thing happened while building the lottie
app, am I doing something wrong?
Currently when the screen orientation is changed then the letters written disappears.
Expected that letters should not disappears on changing the orientation. :)
Before opening a new issue:
If this is a bug:
If this is a feature request:
I have tried placing the sample json files in my device storage, and from the app, they don't seem to be selectable from the default file manager.
Nexus 6P, running latest stable 7.1.1.
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.airbnb.lottie.animatable.AnimatableIntegerValue.(AnimatableIntegerValue.java:25)
at com.airbnb.lottie.model.Layer.fromJson(Layer.java:88)
at com.airbnb.lottie.model.LottieComposition.fromJsonSync(LottieComposition.java:145)
at com.airbnb.lottie.model.LottieComposition.fromInputStream(LottieComposition.java:97)
at com.airbnb.lottie.model.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:266)
at com.airbnb.lottie.model.LottieComposition$FileCompositionLoader.doInBackground(LottieComposition.java:254)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Quite a few of our animations are pre-comp'd as we reuse elements. Bodymovin supports them; Am I doing something wrong and/or is this on the roadmap for Lottie? I'm game to look into it.
in this concept clint sends the requests to the server, at the same time server can maintain the queue and counter, when the client sends the requests counter increased to 1.if the same kind of requests coming from the client server would send error message.if the client repeats samething server abruptly disconnect the communication with that client.this is the main concept of dos attack detection.cn you help to write the java code for this concept.
thank you all
https://developer.android.com/reference/android/graphics/Canvas.html#clipPath(android.graphics.Path, android.graphics.Region.Op)
Ideally when the last page of App Intro has reached, on pressing "DONE" the IntroActivity should be closed by calling finish().
Same bug exists in the Google Play version of the sample.
Not a dealbreaker as such, but my OCD compelled me to open an issue for this. :p
In android please use:
LottieAnimationView animationView = (LottieAnimationView) findViewById(R.id.animation_view);
your sample has
LottieAnimationView animationView = findViewById(R.id.animation_view);
(which will parse to normal view)
Right now neither strong nor weak cache construction is covered with any synchronization primitives. In case of concurrent animation loading (say, showing list of animation for a first time), due to lack of synchronization we can create multiple instances of each cache, thus get worse performance and larger memory usage.
While building Lottie sample android project I am getting build error as:
Minimum supported Gradle version is 3.3. Current version is 2.14.1. If using the gradle wrapper, try editing the distributionUrl.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.