After having spent quite a bit of time searching for this, I need to 
request help here.

I have a series of fragments each representing a "page".
I want to give the user a nice animation effect when going to the next page 
he has requested.

I want that the new fragment slides in *over* the previous fragment, hiding 
it as if it were a solid page.
At present I can slide in the new fragment, but we can still see the 
underlying fragment during the transition.

Here is my "slide in" transition definition :
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android";
    android:fillAfter="false" >
    
    <objectAnimator
        android:duration="500"
        android:propertyName="x"
        android:valueFrom="-1280"
        android:valueTo="0"
        android:valueType="floatType" />
</set>

And here is my fade out transition
<set xmlns:android="http://schemas.android.com/apk/res/android"; 
android:fillAfter="false" >
    <objectAnimator
        android:propertyName="alpha"
        android:duration="500"
        android:valueFrom="1.0"
        android:valueTo="0"
        android:valueType="floatType" />
</set>

I apply it with :
Fragment f = (Fragment)FragClass.newInstance();
FragmentTransactionft = getFragmentManager().beginTransaction();
ft.setCustomAnimations(R.animator.fragment_slide_in, 
R.animator.fragment_fade_out);
ft.replace(R.id.fl_frame, f);
ft.commit();

I have seen the kind of effect I want being demonstrated with the ViewPager 
<http://developer.android.com/training/animation/screen-slide.html#depth-page> 
- but I am using Fragments.
Can this kind of transition (just the moving in from the left bit shown at 
the end) be achieved with fragment animation ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to