top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

I want to add a bouncing effect on imageview below api 11. How should I do it?

0 votes
467 views

In an app there is a floating icon of download. I just want, when I open that page icon should come in screen with bouncing effect. App supporting api version > 8.

Please help.

posted Aug 12, 2014 by Manav

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

For api > 10 u can use it as.

ObjectAnimator animY = ObjectAnimator.ofFloat(imgView, "translationY", -500f, 0f);
                        animY.setDuration(1500);//1.5sec
                        animY.setInterpolator(new BounceInterpolator());
                        animY.setRepeatCount(0);
                        animY.start()

For api < 11 u can use it as:

 TranslateAnimation animation = new TranslateAnimation(
                                Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
                                Animation.RELATIVE_TO_SELF, -3.0f, Animation.RELATIVE_TO_SELF, 0.0f
                            );
                            animation.setDuration(1500);
                            animation.setInterpolator(new BounceInterpolator());
                            imgView.startAnimation(animation);
answer Aug 12, 2014 by Nikhil Omar
Similar Questions
+3 votes

I need to change the Wifi channel programmatically (Of course, I will enable the Wifi to function as Hotsopt first).
Is there any API/Driver in the source code that I can use?

+1 vote

I need to inbuilt BarCode/QR Code scanning feature in one of my android application. I've one api of Zxing ( https://github.com/zxing/zxing) but required some other option.

...