public class AnimatorInflater extends Object
For performance reasons, inflation relies heavily on pre-processing of XML files that is done at build time. Therefore, it is not currently possible to use this inflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser returned from a compiled resource (R. something file.)
Constructor and Description |
---|
AnimatorInflater() |
Modifier and Type | Method and Description |
---|---|
static Animator |
loadAnimator(Context context,
int id)
Loads an
Animator object from a resource |
static Animator |
loadAnimator(Resources resources,
Resources.Theme theme,
int id)
Loads an
Animator object from a resource |
static Animator |
loadAnimator(Resources resources,
Resources.Theme theme,
int id,
float pathErrorScale) |
static StateListAnimator |
loadStateListAnimator(Context context,
int id) |
public static Animator loadAnimator(Context context, @AnimatorRes int id) throws Resources.NotFoundException
Animator
object from a resourcecontext
- Application context used to access resourcesid
- The resource id of the animation to loadResources.NotFoundException
- when the animation cannot be loadedpublic static Animator loadAnimator(Resources resources, Resources.Theme theme, int id) throws Resources.NotFoundException
Animator
object from a resourceresources
- The resourcestheme
- The themeid
- The resource id of the animation to loadResources.NotFoundException
- when the animation cannot be loadedpublic static Animator loadAnimator(Resources resources, Resources.Theme theme, int id, float pathErrorScale) throws Resources.NotFoundException
Resources.NotFoundException
public static StateListAnimator loadStateListAnimator(Context context, int id) throws Resources.NotFoundException
Resources.NotFoundException