ViewPropertyAnimator setDuration - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ViewPropertyAnimator setDuration method.

This code example shows how to use the following methods:alpha, setDuration, setStartDelay
This code example shows how to use the following methods:alpha, scaleX, scaleY, setDuration, setInterpolator
    /** Creates the open/close animation */ 
    private void animateScale(boolean isExitAnimation, final Runnable onAnimationEndRunnable) {
        mChild.setPivotX(mTargetScreen.centerX() - mChild.getLeft());
        mChild.setPivotY(mTargetScreen.centerY() - mChild.getTop());
        ViewPropertyAnimator animator = mChild.animate();
        animator.setDuration(mAnimationDuration);
        final int scaleInterpolator = isExitAnimation ? android.R.interpolator.accelerate_quint
                : android.R.interpolator.decelerate_quint;
        animator.setInterpolator(AnimationUtils.loadInterpolator(getContext(), scaleInterpolator));
        final float scaleTarget = isExitAnimation ? 0.5f : 1.0f;
        animator.scaleX(scaleTarget);
        animator.scaleY(scaleTarget);
        animator.alpha(isExitAnimation ? 0.0f : 1.0f);
 
        if (onAnimationEndRunnable != null) {
            animator.setListener(new AnimatorListener() {
                @Override 
                public void onAnimationStart(Animator animation) {}
 
                @Override 
                public void onAnimationRepeat(Animator animation) {}
7
CodeRank
This code example shows how to use the following methods:alpha, cancel, setDuration, setListener
This code example shows how to use the following methods:alpha, cancel, setDuration, setListener
This code example shows how to use the following methods:setDuration, setInterpolator, x, y
		ViewGroup layout = (ViewGroup) m_tv.getParent();
		layout.setClipChildren(true);
 
		// Go to 50 on x 
		ViewPropertyAnimator vpa = m_tv.animate();
		vpa.x(x);
		vpa.y(y);
 
		vpa.setDuration(5000); // 2 secs
		vpa.setInterpolator(new AccelerateDecelerateInterpolator());
		// vpa.start(); 
	} 
 
	public void testTypeEvaluator(View v) {
		m_tv.setAlpha(1f);
 
		float h = m_tv.getHeight();
		float w = m_tv.getWidth();
		float x = m_tv.getX();
		float y = m_tv.getY();
5
CodeRank
This code example shows how to use the following methods:setDuration, setInterpolator, x, y
    	ViewGroup layout = (ViewGroup)m_tv.getParent();
    	layout.setClipChildren(true);
    	 
    	//Go to 50 on x 
    	ViewPropertyAnimator vpa = m_tv.animate();
    	vpa.x(x);
    	vpa.y(y);
    	 
        vpa.setDuration(5000); //2 secs
        vpa.setInterpolator(
        		new  AccelerateDecelerateInterpolator());
        //vpa.start(); 
    } 
    public void testTypeEvaluator(View v)
    { 
    	m_tv.setAlpha(1f);
    	 
    	float h = m_tv.getHeight();
    	float w = m_tv.getWidth();
    	float x = m_tv.getX();
5
CodeRank
This code example shows how to use the following methods:alpha, setDuration, setStartDelay
This code example shows how to use the following methods:rotation, setDuration, setInterpolator
This code example shows how to use the following methods:alpha, rotationY, scaleX, scaleY, setDuration
-3
CodeRank
This code example shows how to use the following methods:alpha, rotationY, scaleX, scaleY, setDuration
-3
CodeRank

Related ViewPropertyAnimator setDuration Questions & Answers:

setDuration Method Overview
Sets the duration for the underlying animator that animates the requested properties.
See Code Examples for other Android ViewPropertyAnimator Methods: