Animation max size
See original GitHub issueI have animation with following spec:
"v": "4.5.6",
"fr": 25,
"ip": 0,
"op": 38,
"w": 360,
"h": 146,
"ddd": 0,
.......
I want to achieve behavior when animation view fits on screen width. If i set to LottieAnimationView layout_width=“match_parent” and layout_height=“wrap_content” i faced with following issue on phones: if phone’s width is 1440px(samsung s7), animation viewport width is 1000px because of LottieComposition MAX_PIXELS = 1000 constraint. So i got space between animation and screen edge. I solved this issue by dynamically changing view height to proper value:
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float dpWidth = displayMetrics.widthPixels / displayMetrics.density;
float dpHeight = displayMetrics.heightPixels / displayMetrics.density;
mLottieAnimationView.getLayoutParams().height = (int) (displayMetrics.density * 146f / (360f / dpWidth));
After applying new height on view, animation viewport fits screen width well. So my question is this fix save in terms of stability and performance? PS: i don’t have masks or mattes.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
What is the maximum size of animation I can upload to ...
At the moment, the maximum size for an animation can be uploaded to LottieFiles is 35kb.
Read more >How long can a GIF animate? Are there any time restrictions ...
Uploads are limited to 15 seconds, although we recommend no more than 6 seconds. Uploads are limited to 100MB, although we recommend 8MB...
Read more >Google Ad Manager creative requirements - Display & Video ...
Animation length must be 30 seconds or shorter, and animated GIF ads must have a framerate of 5 frames per second or slower....
Read more >What Is The Maximum Image Size For Use In A GIF? - 12854162
I have no personal experience with animated GIFs, but I have found this from Google: ... "The maximum size of image and GIF...
Read more >Preview animations created with a larger frame range set at ...
Preview animations are limited to 1GB in file size when using AVI and MOV file formats. Solution: To solve issues with incomplete movie...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Use centerCrop instead of center.
On Thu, Mar 16, 2017, 3:54 AM Michael notifications@github.com wrote:
I set up width in dp that’s equal to device width and it scale perfectly good. It doesn’t work same with
android:layout_width="match_parent".