Code example for ViewPropertyAnimator

Methods: translationX

0
            dispatchOnPageBeginWarp(); 
            KeyguardWidgetFrame v = (KeyguardWidgetFrame) getPageAt(mPageWarpIndex);
            if (DEBUG_WARP) Log.v(TAG, "moving page on screen: Tx=" + v.getTranslationX());
            DecelerateInterpolator interp = new DecelerateInterpolator(1.5f);
            mWarpAnimation = v.animate();
            mWarpAnimation.translationX(mWarpPeekAmount)
                    .setInterpolator(interp)
                    .setDuration(WARP_PEEK_ANIMATION_DURATION)
                    .setListener(mOnScreenAnimationListener);
        } 
    } 
 
    private void animateWarpPageOffScreen(String reason, boolean animate) {
        if (DEBUG_WARP) Log.v(TAG, "animateWarpPageOffScreen(" + reason + " anim:" + animate + ")");
        if (isWarping()) { 
            dispatchOnPageEndWarp(); 
            KeyguardWidgetFrame v = (KeyguardWidgetFrame) getPageAt(mPageWarpIndex);
            if (DEBUG_WARP) Log.v(TAG, "moving page off screen: Tx=" + v.getTranslationX());
            AccelerateInterpolator interp = new AccelerateInterpolator(1.5f);
            v.animate().translationX(0.0f)
                    .setInterpolator(interp)