ViewPropertyAnimator provides a simple way to animate several properties in parallel, using a single Animator internally.
Questions tagged [viewpropertyanimator]
38 questions
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…

g.revolution
- 11,962
- 23
- 81
- 107
46
votes
5 answers
How to reset view to original state after using animators to animates its some properties?
I am using animators (ObjectAnimator) to animate few properties (scale, rotate) of a view.
Target view is animating properly when ObjectAnimators are set to it.
But there is an added requirement to get view to the original position (reset) after a…

Napolean
- 5,303
- 2
- 29
- 35
24
votes
1 answer
android animate() withEndAction() vs setListener() onAnimationEnd()
Often I use ViewPropertyAnimator and set end action using its withEndAction() function like:
view.animate().translationY(0).withEndAction(new Runnable() {
@Override
public void run() {
// do something
}
}).start();
But also you…

Vitaly Zinchenko
- 4,871
- 5
- 36
- 52
17
votes
2 answers
Android - Zoom animation using AnimatorSet
The official Zooming a View tutorial uses an AnimatorSet to zoom into a View. It creates the illusion of downward movement as the view expands. Later, the AnimatorSet is simply replayed backwards to create the illusion of zoom-out.
What I need to…

Yash Sampat
- 30,051
- 12
- 94
- 120
12
votes
2 answers
Get the width of the parent layout
Android Studio 2.0 beta 6
I am trying to use ViewPropertyAnimator to move a ImageView (ivSettings) inside a toolbar so that it is 20dp from the right and 20dp from the top, from is current location. And move the ImageView (ivSearch) 20dp from the…

ant2009
- 27,094
- 154
- 411
- 609
11
votes
6 answers
How can I repeat a property animation?
I'm doing an animation of bubbles on the screen, but the bubbles stop after finishing the animation time. How do I repeat the animation or make it infinite?
bub.animate();
bub.animate().x(x2).y(y2);
bub.animate().setDuration(animationTime); …

user3901032
- 121
- 1
- 1
- 5
8
votes
3 answers
Animation like switching accounts in Gmail App
Translate of clicked image to active account image and fade out active account image from its position fade in to place of clicked image.

Ashish Kumawat
- 685
- 7
- 22
8
votes
1 answer
Cannot remove ViewPropertyAnimator's listener
When I run this code inside my custom view, onAnimationStart and onAnimationEnd are kept being called repeatedly. Isn't that weird?
As an Android programmer, I expected them to be called only once respectively.
final ViewPropertyAnimator…

Leo
- 1,433
- 23
- 40
6
votes
1 answer
Android ObjectAnimator vs ViewPropertyAnimator
What's the difference between ObjectAnimator and ViewPropertyAnimator changing property value?
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(myObject, "X", 0.0f, 100.0f);
I tried myObject.getX() while above objectAnimator is ongoing, and I…

Hwang
- 206
- 3
- 9
4
votes
1 answer
ViewPropertyAnimator without start call, is there a difference?
Sometimes I see code like
view.animate().alpha(1).start();
And sometimes
view.animate().alpha(1);
What (if any) is the difference?
The animation always starts but from my understanding of the source code two entirely different things happen in…

zoltish
- 2,122
- 19
- 37
3
votes
2 answers
ViewPropertyAnimator - animation wouldn't happen the first time
I'm using the following code for a slide in / slide out toggle for an AppBarLayout.
public void showToolbar(boolean show) {
if (appBar == null) {
Log.e(TAG, "showToolbar: Toolbar is null");
return;
}
boolean toolbarShown…

Binoy Babu
- 16,699
- 17
- 91
- 134
2
votes
1 answer
Android ViewPropertyAnimator silently fails alpha animations on large views
I have a list view that is populated with data from a web request. While waiting for the response I overlay another view on top (mNoDataLayout) with a progress bar and other information telling the user the data is coming. Once the data arrives I…

sleep
- 4,855
- 5
- 34
- 51
1
vote
2 answers
First Time View.getHeight getting "0" after animation ends only I'm getting the height, why?
I have an animation to view Slide up and down in an Activity, I'm using the below code. In the first time, I'm getting the rlView height as "0" once the animation ends only I get the proper height
private void animateView() {
Log.d(TAG,…

Aabauser
- 533
- 1
- 4
- 17
1
vote
1 answer
AnimationSet for Views
I know it is possible to run series of animation at same time with animationset like this :
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new RotateAnimation(this,0));
…

Belvi Nosakhare
- 3,107
- 5
- 32
- 65
1
vote
0 answers
ViewPropertyAnimator's alpha animation does not work
I use ViewPropertyAnimator for creating alpha animations. Both withStartAction() and withEndAction() work great, alpha values changed, but they changed in no time, looks like there is no animation, just changing values. Where is a mistake?
private…

panda_eye
- 166
- 6