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
384
votes
20 answers

Show and hide a View with a slide up/down animation

I have a LinearLayout that I want to show or hide with an Animation that pushes the layout upwards or downwards whenever I change its visibility. I've seen a few samples out there but none of them suit my needs. I have created two xml files for the…
MichelReap
  • 5,630
  • 11
  • 37
  • 99
345
votes
9 answers

Android adding simple animations while setvisibility(view.Gone)

I have designed a simple layout.I have finished the design without animation, but now I want to add animations when textview click event and I don't know how to use it. Did my xml design looks good or not? Any suggestions would be appreciated. My…
arun
  • 3,497
  • 3
  • 14
  • 9
171
votes
3 answers

How do android screen coordinates work?

I am working with Android Animation and I have found the Android coordinate system to be quite confusing so I am here to ask this question about how coordinates work in Android. I am following this image for moving one view to another but it seems…
Yasir Khan
  • 2,413
  • 4
  • 20
  • 26
136
votes
6 answers

Adding Ripple Effect to RecyclerView item

I am trying to add Ripple Effect to RecyclerView's item. I had a look online, but could not find what I need. I assume it has to be a custom effect. I have tried android:background attribute to the RecyclerView itself and set it to…
Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126
130
votes
6 answers

Complete Working Sample of the Gmail Three-Fragment Animation Scenario?

TL;DR: I am looking for a complete working sample of what I'll refer to as "the Gmail three-fragment animation" scenario. Specifically, we want to start with two fragments, like this: Upon some UI event (e.g., tapping on something in Fragment B),…
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
119
votes
6 answers

How to Reverse Fragment Animations on BackStack?

I thought the system would reverse animations on the backstack when the back button is pressed when using fragments using the following code: FragmentManager fm = getFragmentManager(); FragmentTransaction ft =…
user742030
104
votes
10 answers

Show DialogFragment with animation growing from a point

I'm showing a DialogFragment when the user taps on a row in a ListView. I'd like to animate the showing of the dialog so that it grows from the center of the row. A similar effect can be seen when opening a folder from the launcher. One idea that…
Edward Dale
  • 29,597
  • 13
  • 90
  • 129
101
votes
5 answers

End animation event android

I have a fadeout animation in a view (which is inside a fragment), and everytime the animation happens, after it finishes the view redraws itself again. I found a work around doing view.SetVisibility(View.GONE) . But it doesn't wait for the…
Paulo Barros
  • 2,740
  • 8
  • 28
  • 36
100
votes
1 answer

swap fragment in an activity via animation

I want to swap two fragment in an activity via animation.Suppose PageA is for fragement A and left side on the screen and PageB is for fragment B i.e. on the right side of the screen. Now i want that when i click a button on pageA then PageA will…
Deepak Goel
  • 5,624
  • 6
  • 39
  • 53
100
votes
4 answers

Android image scale animation relative to center point

I have an ImageView and I do a simple scale animation to it. Very standard code. My scale_up.xml:
Tomislav Markovski
  • 12,331
  • 7
  • 50
  • 72
99
votes
15 answers

shaking / wobble view animation in android

I created an anim.xml file such as below to shake imageview like IOS icon shaking in android. However it does not provide me same result. Is there any better idea?
Winston
  • 1,800
  • 2
  • 20
  • 30
91
votes
7 answers

Animated Icon for ActionItem

I have been searching everywhere for a proper solution to my problem and I can't seem to find one yet. I have an ActionBar (ActionBarSherlock) with a menu that is inflated from an XML file and that menu contains one item and that one item is shown…
Alex Fu
  • 5,509
  • 3
  • 31
  • 40
86
votes
5 answers

Android - Custom Animation on fragment transaction not running

I'm using Google API 8 (Android 2.2) with support package v4. It doesn't give any error or animation. Transaction: FragmentTransaction transaction = manager.beginTransaction(); transaction.replace(R.id.content,…
adheus
  • 3,985
  • 2
  • 20
  • 33
84
votes
9 answers

Android: show/hide a view using an animation

I've been looking through many google results / questions on here to determine how to show/hide a view via a vertical animation, but I can't seem to find one that's exactly right or not too vague. I have a layout (undo bar) that's below another…
78
votes
4 answers

Expand/Collapse Lollipop toolbar animation (Telegram app)

I'm trying to figure out how the expand/collapse animation of the toolbar is done. If you have a look at the Telegram app settings, you will see that there is a listview and the toolbar. When you scroll down, the toolbar collapse, and when you…
1
2 3
99 100