Android ViewPropertyAnimator - top ranked examples from Open Source projects

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

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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:cancel
    } 
 
    @Override 
    public void cancel() { 
        if (mViewPropertyAnimator != null) {
            mViewPropertyAnimator.cancel();
        } 
    } 
 
    @Override 
    public Animator clone() {
        throw new RuntimeException("Not implemented");
    } 
 
    @Override 
    public void end() { 
        throw new RuntimeException("Not implemented");
    } 
 
    @Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
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
			mUndoToken = null;
 
		} 
		else 
		{ 
			mBarAnimator.cancel();
			mBarAnimator.alpha(0);
 
			mBarAnimator.setDuration(mBarView.getResources().getInteger(
					android.R.integer.config_shortAnimTime));
			mBarAnimator.setListener(new AnimatorListenerAdapter()
			{ 
				@Override 
				public void onAnimationEnd(Animator animation)
				{ 
					mBarView.setVisibility(View.GONE);
					mUndoMessage = null;
					mUndoToken = null;
				} 
			}); 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:translationX
     */ 
    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);
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setListener
        animator.addUpdateListener(this);
    } 
 
    public FirstFrameAnimatorHelper(ViewPropertyAnimator vpa, View target) {
        mTarget = target;
        vpa.setListener(new AnimatorListenerAdapter() {
                public void onAnimationStart (Animator animation) {
                    final ValueAnimator va = (ValueAnimator) animation;
                    va.addUpdateListener(FirstFrameAnimatorHelper.this);
                    onAnimationUpdate(va);
                } 
            }); 
    } 
 
    public static void initializeDrawListener(View view) {
        if (sGlobalDrawListener != null) {
            view.getViewTreeObserver().removeOnDrawListener(sGlobalDrawListener);
        } 
        sGlobalDrawListener = new ViewTreeObserver.OnDrawListener() {
                private long mTime = System.currentTimeMillis();
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:alpha, setDuration, setStartDelay

Related Android ViewPropertyAnimator Questions & Answers:

See Code Examples for Android ViewPropertyAnimator Methods: