To show animation on any view like on ImageView, I am implementing animation to show slide a view from top to bottom.
We need to create an xml file in anim folder. Here name top_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="1000"
android:fromYDelta="-100%p"
android:toYDelta="0" />
</set>
Then we need to implement this from code.
mDownArrowImageView is the animation on which I am implementing animation.
private Animation mAnimationSlide;
mAnimationSlide = AnimationUtils.loadAnimation(MainActivity.this, R.anim.top_bottom);
mDownArrowImageView.startAnimation(mAnimationSlide);
0 Comment(s)