当前位置: 首页>>代码示例>>Java>>正文


Java ViewPropertyAnimatorUpdateListener类代码示例

本文整理汇总了Java中android.support.v4.view.ViewPropertyAnimatorUpdateListener的典型用法代码示例。如果您正苦于以下问题:Java ViewPropertyAnimatorUpdateListener类的具体用法?Java ViewPropertyAnimatorUpdateListener怎么用?Java ViewPropertyAnimatorUpdateListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewPropertyAnimatorUpdateListener类属于android.support.v4.view包,在下文中一共展示了ViewPropertyAnimatorUpdateListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAnimatorToHeadView

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
public void createAnimatorToHeadView(final View v, final float angle)
{
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.rotationX(90);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(mChildView);
            mHeadLayout.setPivotX(mHeadLayout.getWidth() / 2);
            mHeadLayout.setPivotY(height);
        }
    });
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:17,代码来源:PerseiLayout.java

示例2: ensureOrCancelAnimator

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
/**
 * Manage animation for Android >= KITKAT
 *
 * @param child
 */
private void ensureOrCancelAnimator(V child, boolean withAnimation) {
	if (translationAnimator == null) {
		translationAnimator = ViewCompat.animate(child);
		translationAnimator.setDuration(withAnimation ? ANIM_DURATION : 0);
		translationAnimator.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
			@Override
			public void onAnimationUpdate(View view) {
				if (navigationPositionListener != null) {
					navigationPositionListener.onPositionChange((int) (view.getMeasuredHeight() - view.getTranslationY() + snackBarY));
				}
			}
		});
		translationAnimator.setInterpolator(INTERPOLATOR);
	} else {
		translationAnimator.setDuration(withAnimation ? ANIM_DURATION : 0);
		translationAnimator.cancel();
	}
}
 
开发者ID:RockyQu,项目名称:MVPFrames,代码行数:24,代码来源:BottomNavigationBehavior.java

示例3: updateViewPropertiesToTaskTransform

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
void updateViewPropertiesToTaskTransform(DeckChildViewTransform toTransform, int duration,
                                         ViewPropertyAnimatorUpdateListener updateCallback) {
    // Apply the transform
    toTransform.applyToTaskView(this, duration, mConfig.fastOutSlowInInterpolator, false,
            !mConfig.fakeShadows, updateCallback);

    // Update the task progress
    DVUtils.cancelAnimationWithoutCallbacks(mTaskProgressAnimator);
    if (duration <= 0) {
        setTaskProgress(toTransform.p);
    } else {
        mTaskProgressAnimator = ObjectAnimator.ofFloat(this, "taskProgress", toTransform.p);
        mTaskProgressAnimator.setDuration(duration);
        mTaskProgressAnimator.addUpdateListener(mUpdateDimListener);
        mTaskProgressAnimator.start();
    }
}
 
开发者ID:jzhu1224,项目名称:DeckView,代码行数:18,代码来源:DeckChildView.java

示例4: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(v);
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:16,代码来源:PerseiLayout.java

示例5: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(250);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(v);
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:smuyyh,项目名称:SprintNBA,代码行数:16,代码来源:MaterialRefreshLayout.java

示例6: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = Math.abs(ViewCompat.getTranslationY(v));
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:skyxin888,项目名称:PulltoRefreshLayout,代码行数:16,代码来源:PulltoRefreshLayout.java

示例7: applyToTaskView

import android.support.v4.view.ViewPropertyAnimatorUpdateListener; //导入依赖的package包/类
/**
 * Applies this transform to a view.
 */
public void applyToTaskView(View v, int duration, Interpolator interp, boolean allowLayers,
                            boolean allowShadows, ViewPropertyAnimatorUpdateListener updateCallback) {
    // Check to see if any properties have changed, and update the task view
    if (duration > 0) {
        ViewPropertyAnimatorCompat anim = ViewCompat.animate(v);
        boolean requiresLayers = false;

        // Animate to the final state
        if (hasTranslationYChangedFrom(v.getTranslationY())) {
            anim.translationY(translationY);
        }
        if (allowShadows && hasTranslationZChangedFrom(ViewCompat.getTranslationZ(v))) {
            anim.translationZ(translationZ);
        }
        if (hasScaleChangedFrom(v.getScaleX())) {
            anim.scaleX(scale)
                    .scaleY(scale);
            requiresLayers = true;
        }
        if (hasAlphaChangedFrom(v.getAlpha())) {
            // Use layers if we animate alpha
            anim.alpha(alpha);
            requiresLayers = true;
        }
        if (requiresLayers && allowLayers) {
            anim.withLayer();
        }
        if (updateCallback != null) {
            anim.setUpdateListener(updateCallback);
        } else {
            anim.setUpdateListener(null);
        }
        anim.setStartDelay(startDelay)
                .setDuration(duration)
                .setInterpolator(interp)
                .start();
    } else {
        // Set the changed properties
        if (hasTranslationYChangedFrom(v.getTranslationY())) {
            v.setTranslationY(translationY);
        }
        if (allowShadows && hasTranslationZChangedFrom(ViewCompat.getTranslationZ(v))) {
            ViewCompat.setTranslationZ(v, translationZ);
        }
        if (hasScaleChangedFrom(v.getScaleX())) {
            v.setScaleX(scale);
            v.setScaleY(scale);
        }
        if (hasAlphaChangedFrom(v.getAlpha())) {
            v.setAlpha(alpha);
        }
    }
}
 
开发者ID:jzhu1224,项目名称:DeckView,代码行数:57,代码来源:DeckChildViewTransform.java


注:本文中的android.support.v4.view.ViewPropertyAnimatorUpdateListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。