Android - Fazendo traduções e objectAnimator no mesmo arquivo XML

Eu tenho tentado fazer um efeito de rotação 3D Cube enquanto deslizava de um fragmento para outro. Primeiro eu estava usando um efeito de tradução (em XML) chamando comFragmentTransaction.setCustomAnimations(...) e então, ao abrir / fechar o fragmento, eu estava jogando com a classe Camera para fazer a rotação.

Isso estava funcionando FINE, mas parece que eu tenho muito (não me pergunte por que) usar toda essa animação usando apenas o arquivo XML. Depois de uma longa pesquisa descobri que eu deveria usar objectAnimator para fazer a rotação.

Segui o exemplo do Google e consegui fazer a animação do flip. Agora eu preciso traduzir os fragmentos fazendo-os deslizar e deslizar para fora. Parece que eu não posso usar objectAnimator e traduzir o efeito no mesmo arquivo XML. Desde que este erro aparece:

java.lang.RuntimeException: Unknown animator name: translate at (...)

Alguma idéia de como eu posso fazer o efeito deslizante e usar o objectAnimator ao mesmo tempo?

Obrigado pelo seu tempo!

Código que tenho usado:

card_flip_right_in.xml

<set xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- Before rotating, immediately set the alpha to 0. -->
    <objectAnimator
        android:duration="0"
        android:propertyName="alpha"
        android:valueFrom="1.0"
        android:valueTo="0.0" />

    <!-- Rotate. -->
    <objectAnimator
        android:duration="@integer/card_flip_time_full"
        android:interpolator="@android:interpolator/accelerate_decelerate"
        android:propertyName="rotationY"
        android:valueFrom="180"
        android:valueTo="0" />

    <!-- Half-way through the rotation (see startOffset), set the alpha to 1. -->
    <objectAnimator
        android:duration="1"
        android:propertyName="alpha"
        android:startOffset="@integer/card_flip_time_half"
        android:valueFrom="0.0"
        android:valueTo="1.0" />

</set>

Fragmento chamando outro fragmento: (a rotação do cubo deve ficar visível entre este 2)

private void launchArticle(int prev, int pos){
        ArticleFragment newFragment = new ArticleFragment();
        Bundle args = new Bundle();
        args.putString("pos", pos);
        args.putInt("prev", prev);
        newFragment.setArguments(args);
        android.app.FragmentTransaction transaction = getFragmentManager().beginTransaction();
        Fragment currFrag = (Fragment)getFragmentManager().findFragmentById(R.id.headlines_fragment);
        if (currFrag != null) {
                transaction.hide(currFrag);
        }
        transaction.setCustomAnimations(
                R.animator.card_flip_right_in,
                R.animator.card_flip_right_out,
                R.animator.card_flip_left_in,
                R.animator.card_flip_left_out
                );

        transaction.replace(R.id.fragment_container, newFragment, pos);
        transaction.addToBackStack(null);

        transaction.commit();
}

ATUALIZAR:

Eu consegui resolver o problema anterior usando uma classe que estende meu framelayout dos fragmentos que estou usando

SlidingFrameLayout.java

public class SlidingFrameLayout extends FrameLayout
{
    private static final String TAG = SlidingFrameLayout.class.getName();
    public SlidingFrameLayout(Context context) {
        super(context);
    }

    public SlidingFrameLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public float getXFraction()
    {
        final int width = getWidth();  
        if(width != 0) return getX() / getWidth();  
        else return getX();  
    }

    public void setXFraction(float xFraction) {
        final int width = getWidth();  
        setX((width > 0) ? (xFraction * width) : -9999);  
    }

    public float getYFraction()
    {
        final int height = getHeight();  
        if(height != 0) return getY() / getHeight(); else return getY();   
    }

    public void setYFraction(float yFraction) {
        final int height = getHeight();  
        setY((height > 0) ? (yFraction * height) : -9999);  
    }
}

e adicionando isso ao objectAnimator:

<!-- Move -->
    <objectAnimator
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:duration="@integer/card_flip_time_full"
        android:interpolator="@android:anim/linear_interpolator"
        android:propertyName="xFraction"
        android:valueFrom="-1"
        android:valueTo="0" />

Isso está funcionando melhor, mas os eixos de rotação estão no meio do FrameLayout e não estão fazendo a ilusão de um cubo ... É possível definir os eixos de rotação em um certo ponto?

questionAnswers(2)

yourAnswerToTheQuestion