Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ObjectAnimator in API Level < 11

So I'm getting really frustrated with android and the fact half the stuff doesn't work when you roll back the API Level past 11. Why isn't it easy and well done like iOS?!

The Problem I am using ObjectAnimators to animate the transitioning between Fragments. They work fine in anything with API Level 11 and above. As soon as I change the build target to less than 11 I get problems with it saying it can't found the resource identifiers for attributes such as propertyName and valueType in the xml file.

The Question What should I use instead to animate my Fragment transitions that will work on API Levels > 7.

Thanks in advance.

like image 769
StuStirling Avatar asked Jul 24 '12 10:07

StuStirling


People also ask

What is the use of ObjectAnimator API?

This subclass of ValueAnimator provides support for animating properties on target objects. The constructors of this class take parameters to define the target object that will be animated as well as the name of the property that will be animated.


2 Answers

I suggest using http://nineoldandroids.com/ , its from the same maker of the ActionBarSherlock project, it introduces a support ObjectAnimator that works from API 1 onwards.

like image 70
Rafael Nobre Avatar answered Sep 17 '22 20:09

Rafael Nobre


Property Animation Introduced in Android 3.0 (API level 11)

For support lower android version, (I didn't try it, but you can use)

Nine Old Androids Download

Android library for using the Honeycomb (Android 3.0) animation API on all versions of the platform back to 1.0!.

Also Look at this blog Fragment Transactions Reference

and this SO question Android Fragment standard transition not animating

like image 41
user370305 Avatar answered Sep 17 '22 20:09

user370305