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

2.5.4 Setting LottieAnimationView Visibility doesn't work #737

Closed
ghost opened this issue Apr 24, 2018 · 1 comment
Closed

2.5.4 Setting LottieAnimationView Visibility doesn't work #737

ghost opened this issue Apr 24, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 24, 2018

How to reproduce: (Basic fragment with Relative Layout)
2 LottieAnimationView's in the same layout (RelativeLayout)
1 view will show and then when the animation finishes, the second view will show and the first will be hidden.
Programmatic change in visibility is not working.
LottieAnimationView.visibility = View.GONE / View.INVISIBLE / View.VISIBLE is not working

Lottie Version: 2.5.4.
Verified that this working in version 2.5.3.

AfterEffects files sent to lottie@airbnb.com

@ghost ghost changed the title 2.5.4 Setting LottieAnimationView Visibility doesn't work 2.5.4 Setting LottieAnimationView Changing Visibility doesn't work Apr 24, 2018
@ghost ghost changed the title 2.5.4 Setting LottieAnimationView Changing Visibility doesn't work 2.5.4 Setting LottieAnimationView Visibility doesn't work Apr 24, 2018
@gpeal
Copy link
Collaborator

gpeal commented May 7, 2018

@lyew-phunware I can't repro this. I modified BullseyeActivity in the sample app to test this:
I modified activity_bullseye:

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animationView"
        android:layout_width="256dp"
        android:layout_height="256dp"
        app:lottie_rawRes="@raw/bullseye"
        app:lottie_autoPlay="true"
        android:layout_gravity="center"/>

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animationView2"
        android:layout_width="256dp"
        android:layout_height="256dp"
        android:layout_marginTop="128dp"
        app:lottie_rawRes="@raw/bullseye"
        android:visibility="gone"
        android:layout_gravity="center"/>

and added this in BullseyeActivity#onCreate

        animationView.addAnimatorListener(AnimatorListenerAdapter(
                onEnd = {
                    animationView.visibility = View.GONE
                    animationView2.visibility = View.VISIBLE
                    animationView2.playAnimation()
                }
        ))

and it worked as expected
bullseye

If you can make a sample project that repros this, feel free to reopen it.

The likely change in behavior from 2.5.3 to 2.5.4 is this but that should only make things better unless you had a hack to workaround the broken behavior before.

@gpeal gpeal closed this as completed May 7, 2018
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

1 participant