I have set android:animateLayoutChanges
to true
for my LinearLayout
:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="top"
android:animateLayoutChanges="true">
</LinearLayout>
Then, I run the following to animate the disappearance of an element.
TextView line;
...
line.setVisibility(View.GONE);
How can I know when the animation has finished?
Same question to me, this post will help you. https://stackoverflow.com/a/17869028
First, get LayoutTransition
from LinearLayout
using getLayoutTransition
method.
Then add TransitionListener
to layout transition you got.
This method available for api-level 11
and above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With