Rotation X Bottom RecyclerView - Android User Interface

Android examples for User Interface:RecyclerView

Description

Rotation X Bottom RecyclerView

Demo Code


import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.animation.DecelerateInterpolator;

public class Main{
    public static void RotationXBottomACW(
            final RecyclerView.ViewHolder holder, int duration) {
        View view = holder.itemView;
        clear(view);//from w w  w. j a  va 2  s.  c om
        view.setPivotX(0);
        view.setPivotY(view.getHeight());
        ViewCompat.setRotationX(view, 90);
        ViewCompat.animate(view).rotationXBy(-90)
                .setInterpolator(new DecelerateInterpolator(2.f))
                .setDuration(duration).start();
    }
    public static void clear(View v) {
        ViewCompat.setAlpha(v, 1);
        ViewCompat.setScaleY(v, 1);
        ViewCompat.setScaleX(v, 1);
        ViewCompat.setTranslationY(v, 0);
        ViewCompat.setTranslationX(v, 0);
        ViewCompat.setRotation(v, 0);
        ViewCompat.setRotationY(v, 0);
        ViewCompat.setRotationX(v, 0);
        ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2);
        ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2);
        ViewCompat.animate(v).setInterpolator(null).setStartDelay(0);
    }
}

Related Tutorials