ObjectAnimator in API Level < 11
Asked Answered
D

2

28

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.

Doublethink answered 24/7, 2012 at 10:10 Comment(2)
Property Animation Introduced in Android 3.0 (API level 11).Alkane
Sorry for the noob query. I understand we cannot build pre-3.0, but does this also mean that the animations using Property animation (on an app built using 4.4) will not run on devices pre-3.0 ?Yellowweed
P
26

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.

Phonogram answered 17/12, 2012 at 11:28 Comment(7)
but, how to integrate nineoldandroids with support fragment animation?Mesne
This is a useful library and giving backward support @nobre said.Trimming
Sadly this seems to be the case even after appcompat-v7 18.0 :(Br
Even for appcompat-v7 20.0. However I would not expect that anymore.Oldie
Welp, not in AppCompat v21, either. Hopefully, we'll get this someday.Trophic
Not in AppCompat v22, either.Healthful
Not in appcompat-v7:23.0.1 as well.Romine
A
2

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

Alkane answered 24/7, 2012 at 10:34 Comment(3)
AFAIK, the support library does not include the property animation classes.Fredella
Call requires API level 12 (current min is 11): android.view.ViewPropertyAnimator#scaleXLyrism
Nine Old Androids is now deprecated.Hobard

© 2022 - 2024 — McMap. All rights reserved.