0

I want to decrease and increase bitmap of alpha every one second please help me.I want to create animation like fade in fade out bitmap on canvas.

  • This blog shows you how you can do that http://android-er.blogspot.in/2012/02/animate-fade-infade-out-by-changing.html – Ogen Aug 01 '14 at 05:31
  • you can see this http://stackoverflow.com/questions/18229088/android-fade-out-bitmap-image-on-canvas – Kaushik Aug 01 '14 at 06:08

1 Answers1

0

Try this simple way

public void animateImage(Context mContext,ImageView imgSplash){
         try{
             Animation myFadeInAnimation = AnimationUtils.loadAnimation(mContext, R.anim.fade_in);
             imgSplash.startAnimation(myFadeInAnimation);

         }catch (Exception e){

         }
     }

Add this fade_in.xml in res/anim folder

<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator"
        android:duration="4000" android:repeatCount="0"/>
</set>
Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77