The more modern way of doing this is to use the ViewPropertyAnimator
:
view.animate()
.alpha(0f)
.withEndAction(new Runnable() {
@Override
public void run() {
// Do something.
}
})
.start();
Or, if you’re using RetroLambda:
view.animate()
.alpha(0f)
.withEndAction(() -> {
// Do something.
})
.start();
Related Contents:
- Android: Expand/collapse animation
- Animate change of view background color on Android
- Show and hide a View with a slide up/down animation
- How to stop an animation (cancel() does not work)
- How to make a smooth image rotation in Android?
- How to Animate Addition or Removal of Android ListView Rows
- Android Left to Right slide animation
- How to switch activity without animation in Android?
- Fade In Fade Out Android Animation in Java
- Can I change the Android startActivity() transition animation?
- Animate visibility modes, GONE and VISIBLE
- How to provide animation when calling another activity in Android?
- Fragment transaction animation: slide in and slide out
- Animate a custom Dialog
- How can I add an animation to the activity finish()
- Setting android:animateLayoutChanges programmatically
- How to perform a fade animation on Activity transition?
- Android – how to get android.R.anim.slide_in_right
- Android fade in and fade out with ImageView
- Swipe List Item for more options (Flutter)
- Android animation does not repeat
- How do I animate View.setVisibility(GONE)
- How to animate a view in Android and have it stay in the new position/size?
- Animate ProgressBar update in Android
- Circular reveal transition for new activity
- Change ViewPager animation duration when sliding programmatically
- Android scale animation on view
- Disabling animation in ViewPager
- android animation is not finished in onAnimationEnd
- How to implement ItemAnimator of RecyclerView to disable the animation of notifyItemChanged
- Set default page for ViewPager in Android
- Why doesn’t setVisibility work after a view is animated?
- Android — How to position View off-screen?
- How to achieve right to left animation to start the activity
- How to draw a circle with animation in android with circle size based on a value
- Slidedown and slideup layout with animation
- Android properties that can be animated with ObjectAnimator
- Android Animate Rotate
- animateLayoutChanges=”true” in BottomSheetView showing unexpected behaviour
- onAnimationEnd is not getting called, onAnimationStart works fine
- Animating fragments and the back stack
- TaskStackBuilder transition animation
- Reversing an Animation
- How to expand a layout height with animation?
- Display Activity From Bottom to Top
- How to make text fade in and out in Android?
- How to fill a view with another with Material Design Animation?
- Resizing layouts programmatically (as animation)
- How to create an animated GIF from JPEGs in Android (development)
- Android – How to animate an activity transition when the default back button is pressed