Created
October 23, 2014 09:37
-
-
Save realdadfish/b57a9b235a9cb4c450c6 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 ViewUtils | |
{ | |
/** | |
* Starts animations inside a LayerDrawable | |
* | |
* @param drawable | |
*/ | |
public static void startLayerAnimation(LayerDrawable drawable) | |
{ | |
for (int i = 0; i < drawable.getNumberOfLayers(); ++i) | |
{ | |
Drawable dr = drawable.getDrawable(i); | |
if (dr instanceof Animatable) | |
{ | |
((Animatable) dr).start(); | |
} | |
if (dr instanceof LayerDrawable) | |
{ | |
startLayerAnimation((LayerDrawable) dr); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment