Questions tagged [android-animation]

Animations can be integrated into Android apps, either with XML in traditional View layouts or with Kotlin/Java in both traditional and Jetpack Compose layouts.

Android animations can use a few default interpolators (these specify whether the animation goes at the same speed, or, for example, speeds up or slows down), and custom ones can be created.

Android Animation Reference

5590 questions
78
votes
12 answers

FragmentTransaction animation to slide in over top

I am trying to achieve the following effect using FragmentTransaction.setCustomAnimations. Fragment A is showing Replace Fragment A with Fragment B. Fragment A should remain visible during the replacement. Fragment B should slide in from the…
Matt Accola
  • 4,090
  • 4
  • 28
  • 37
76
votes
9 answers

How to apply slide animation between two activities in Android?

I want to achieve a sliding effect from left to right when I move from one activity to another. For that I am using the following code, but I am not getting any results. Please correct me. In java both…
Jignesh Ansodariya
  • 12,583
  • 24
  • 81
  • 113
75
votes
11 answers

How to make the textview blinking

Guys i have a textview which i need it to be blinking please help me with it.
Goofy
  • 6,098
  • 17
  • 90
  • 156
72
votes
8 answers

Android property animation: how to increase view height?

How to increase the view height using Property Animations in Android? ObjectAnimator a = ObjectAnimator.ofFloat(viewToIncreaseHeight, "translationY", -100); a.setInterpolator(new…
72
votes
2 answers

What is the difference between an Animator and an Animation?

It looks like both Animations and Animators allow me to animate properties (position, opacity, scale, rotation, etc) on objects, and I'm having a hard time differentiating between the use case for both. When should I use an animator versus an…
adamdport
  • 11,687
  • 14
  • 69
  • 91
71
votes
3 answers

Android FragmentTransaction Custom Animation (Unknown Animator Name: Translate)

I'm trying to get a custom animation to work with my fragment. I've followed the online tutorials but I've been getting the below error: java.lang.RuntimeException: Unknown animator name: translate The XML for the animation is below:
SalicBlu3
  • 1,874
  • 2
  • 19
  • 32
70
votes
12 answers

android animation is not finished in onAnimationEnd

It seems that an android animation is not truly finished when the onAnimationEnd event is fired although animation.hasEnded is set to true. I want my view to change it's background drawable on the end of it's ScaleAnimation which it does, but you…
ShadowMare
  • 2,087
  • 2
  • 25
  • 27
70
votes
11 answers

Cannot start this animator on a detached view! reveal effect

I'm trying to create the reveal effect in my application but without success. What i want is reveal a cardview when i open a fragment. What i tried so far is: private void toggleInformationView(View view) { infoContainer =…
Atlas91
  • 5,754
  • 17
  • 69
  • 141
70
votes
6 answers

animateLayoutChanges does not work well with nested layout?

I have a nested layout like the following: ... ... …
Chen
  • 1,566
  • 1
  • 12
  • 16
70
votes
18 answers

Android - Expandable TextView with Animation

I have a TextView which firstly shows a small portion of a long text. The user can press a "see more" button to expand the TextView and see the rest of that text. Making tests, I can reach that by simply interchange the value of TextView.setMaxLines…
Jorge Gil
  • 4,265
  • 5
  • 38
  • 57
68
votes
1 answer

How to make Beautiful & Stylish apps like Timely

A Quote from Google in terms of Designing, and some example of apps: Based on what Google said in http://developer.android.com/ within design section, a developer should consider three goals: Enchant me Simplify my life Make me amazing Which BTW…
68
votes
6 answers

Android View Disappearing When Go Outside Of Parent

I have a LinearLayout and ImageView inside this LinearLayout. There is a translation effect for ImageView. // v = ImageView ObjectAnimator animation2 = ObjectAnimator.ofFloat(v, "translationY", 200); …
Eray
  • 7,038
  • 16
  • 70
  • 120
68
votes
5 answers

Android - Change left margin using animation

I am changing the left margin of an image view in the following manner : ViewGroup.MarginLayoutParams layoutParams = (MarginLayoutParams) image.getLayoutParams (); layoutParams.leftMargin = VALUE; image.setLayoutParams ( layoutParams ); I would…
Leeeeeeelo
  • 4,333
  • 3
  • 34
  • 44
65
votes
9 answers

Android ImageView Animation

I've created a layout with an image view and a web view. The web view is set to have a default visibility of gone. When the activity fires up it displays the image view first and when the web view has finished loading its url, it marks itself as…
cakeforcerberus
  • 4,657
  • 6
  • 32
  • 42
64
votes
7 answers

ListView item scroll animation ("UIKit Dynamics" -like)

I am attempting to animate the ListView items when a scroll takes place. More specifically, I am trying to emulate the scroll animations from the iMessage app on iOS 7. I found a similar example online: To clarify, I'm trying to achieve the "fluid"…
b_yng
  • 14,136
  • 6
  • 32
  • 35