Code example for ViewPropertyAnimator

Methods: translationX

0
            return false; 
        } 
        if (event.getAction() == MotionEvent.ACTION_UP) {
            mCurrentPage = getDesiredPage();
            snapToEdgeSmooth(); 
            return true; 
        } 
        return false; 
    } 
 
    /** 
     * Starts an "appear" animation by moving in the "Updates" from the right. 
     */ 
    public void animateAppear() { 
        final int x = Math.round((1.0f - FRAGMENT_WIDTH_SCREEN_WIDTH_FRACTION) * getWidth());
        mUpdatesFragment.setTranslationX(x);
        final ViewPropertyAnimator animator = mUpdatesFragment.animate();
        animator.translationX(0.0f);
    } 
}