Created
September 14, 2016 13:20
-
-
Save abarza/6cce5178ca30fa5d8dbbc55694babbeb to your computer and use it in GitHub Desktop.
Animation method to android element (compatible with api 10).
Use view.setAlpha(alpha) from api 11
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 void setAnimation(float fromAlpha, float toAlpha, long duration, View view){ | |
AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha); | |
alpha.setDuration(duration); // Make animation instant | |
alpha.setFillAfter(true); // Tell it to persist after the animation ends | |
view.startAnimation(alpha); //Attach to l | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment