Skip to content

Instantly share code, notes, and snippets.

@realdadfish
Created October 23, 2014 09:37
Show Gist options
  • Save realdadfish/b57a9b235a9cb4c450c6 to your computer and use it in GitHub Desktop.
Save realdadfish/b57a9b235a9cb4c450c6 to your computer and use it in GitHub Desktop.
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