I need to make animation between Activities or Fragments like this. I use Android Api >=14.
http://www.youtube.com/watch?v=cNMqIv5Ocnk - it's Nexus5 Launcher
I`ve already tried animation with Android ObjectAnimator, but it wasn't very similar to this video animation.
Thanks in advance.
I`ve tried this code
(gla_on.xml):
<objectAnimator
android:duration="0"
android:propertyName="alpha"
android:valueFrom="1.0"
android:valueTo="0.0" />
<objectAnimator
android:duration="1000"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:propertyName="scaleY"
android:valueFrom="1"
android:valueTo="12" />
<objectAnimator
android:duration="1000"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:propertyName="scaleX"
android:valueFrom="1"
android:valueTo="12" />
gla_off.xml:
<objectAnimator
android:duration="0"
android:propertyName="alpha"
android:valueFrom="0.0"
android:valueTo="1.0" />
<objectAnimator
android:duration="1000"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:propertyName="scaleY"
android:valueFrom="1"
android:valueTo="12" />
<objectAnimator
android:duration="1000"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:propertyName="scaleX"
android:valueFrom="1"
android:valueTo="12" />
and put it into this fragment of code:
getFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.gla_on, R.anim.gla_off)
.replace(R.id.container, new NextFragment())
.addToBackStack(null)
.commit();
but NextFragment doesn't show
CLOSED
After many attempts I found the decision.
(You can watch the result here - http://www.youtube.com/watch?v=Npn0c68OkYs )
I create 4 animations in Android Resource folder anim
gla_there_come.xml
gla_there_gone.xml
gla_back_gone.xml
gla_back_come.xml
and I added the code below into my FragmentActivity: