Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It show error page when I use Lottie. #301

Closed
wdmxzf opened this issue May 17, 2017 · 4 comments
Closed

It show error page when I use Lottie. #301

wdmxzf opened this issue May 17, 2017 · 4 comments

Comments

@wdmxzf
Copy link

wdmxzf commented May 17, 2017

It is found in my page of fragment, the picture is
error

@gpeal
Copy link
Collaborator

gpeal commented May 17, 2017

@wdmxzf Try making your animation smaller? The After Effects composition size gets converted from pixels to dps. See what happens when you make your composition like 200px wide max

@wdmxzf
Copy link
Author

wdmxzf commented May 20, 2017

This is my layout

<com.airbnb.lottie.LottieAnimationView
                android:id="@+id/animation_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:lottie_fileName="measure_animation.json"
                app:lottie_loop="true"
                app:lottie_autoPlay="true"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:scaleType="centerCrop"/>

And the bug is happening in OPPO R831S , Galaxy Note II(GT-N7100) and so on.
2017-05-20 6 43 47
Above are the device.

@gpeal
Copy link
Collaborator

gpeal commented May 20, 2017

@wdmxzf I understand that. There are limitations in the Android drawing framework that limits the size of the canvas that can be used for a matte. In this case, it appears as if the composition is drawing larger than the screen and being scaled down but everything that was originally larger than the screen is getting clipped. Try making your AE comp smaller or using the setScale method on LottieAnimationView

@wdmxzf
Copy link
Author

wdmxzf commented May 24, 2017

Thank you for your help.

@gpeal gpeal closed this as completed May 27, 2017
gpeal pushed a commit that referenced this issue Jul 27, 2017
Previously, animations were given a max scale due to saveLayer,
which is used for mattes and masks, only saving the canvas size.
This is problematic when the scale makes the animations larger
than the view because the masks and mattes get clipped. This gets
around that by scaling up the animation up until the size of the
view then scaling the canvas with the remaining scale.

#395 #301 #161 #326 #315
Fixes #404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants