I want to make an edittext which aligns in its parent's left and when users click it, edittext's width'll increase to right side. Here is the code that i used. But when animation ended, edittext width come to first size.
Can any one help me.?
And is there any solution to set "fillparent" to width's final size in animation?
Animation scaleAnimation = new ScaleAnimation(0, -500, 1, 1);
scaleAnimation.setDuration(750);
editText.startAnimation(scaleAnimation);
I added scaleAnimation.setFillAfter(true);
before animation starts but i get this;
After 750ms, edittext is going to its first width.
This will definitely work for you.
scale.xml (Put this in res/anim folder)
Java Code:
Do this
Give a try to this one.
Animation scaleAnimation = new ScaleAnimation(0, -500, 1, 1);
Use
Or use ObjectAnimator: