Created
May 27, 2015 00:20
-
-
Save masarugen/1f7361e7cc1ecae818a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AlphaImageView extends ImageView { | |
private static final int FADE_IN_TIME_MS = 10000; | |
public AlphaImageView(Context context) { | |
super(context); | |
} | |
public AlphaImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public AlphaImageView(Context context, AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
} | |
@Override | |
public void setImageBitmap(Bitmap bm) { | |
AlphaAnimation fadeIn = new AlphaAnimation(0, 1); | |
fadeIn.setDuration(FADE_IN_TIME_MS); | |
fadeIn.setInterpolator(new LinearInterpolator()); | |
super.setImageBitmap(bm); | |
startAnimation(fadeIn); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment