setAnimationListener()源码实例Demo

android.view.animation.ScaleAnimation#setAnimationListener()源码实例Demo

下面列出了android.view.animation.ScaleAnimation#setAnimationListener() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: osmdroid   文件: MapController.java
public MapController(MapView mapView) {
    mMapView = mapView;

    // Keep track of initial layout
    mReplayController = new ReplayController();
    if (!mMapView.isLayoutOccurred()) {
        mMapView.addOnFirstLayoutListener(this);
    }


    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        ZoomAnimationListener zoomAnimationListener = new ZoomAnimationListener(this);
        mZoomInAnimationOld = new ScaleAnimation(1, 2, 1, 2, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
        mZoomOutAnimationOld = new ScaleAnimation(1, 0.5f, 1, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        mZoomInAnimationOld.setDuration(Configuration.getInstance().getAnimationSpeedShort());
        mZoomOutAnimationOld.setDuration(Configuration.getInstance().getAnimationSpeedShort());
        mZoomInAnimationOld.setAnimationListener(zoomAnimationListener);
        mZoomOutAnimationOld.setAnimationListener(zoomAnimationListener);
    }
}
 
源代码2 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个中心点缩放动画
 * @param fromX             动画开始前在 X 坐标
 * @param toX               动画结束后在 X 坐标
 * @param fromY             动画开始前在 Y 坐标
 * @param toY               动画结束后在 Y 坐标
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个中心点缩放动画
 */
public static ScaleAnimation getScaleAnimationCenter(final float fromX, final float toX, final float fromY, final float toY,
                                                     final long durationMillis, final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY,
            ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
            ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码3 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个缩小动画
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个缩小动画
 */
public static ScaleAnimation getLessenScaleAnimation(final long durationMillis, final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f,
            ScaleAnimation.RELATIVE_TO_SELF, ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码4 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个放大动画
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个放大动画
 */
public static ScaleAnimation getAmplificationAnimation(final long durationMillis, final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
            ScaleAnimation.RELATIVE_TO_SELF, ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码5 项目: SprintNBA   文件: AnimationUtils.java
/**
 * 获取一个缩小动画
 *
 * @param durationMillis    时间
 * @param animationListener 监听
 * @return 一个缩小动画
 */
public static ScaleAnimation getLessenScaleAnimation(long durationMillis, Animation.AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f,
            0.0f, ScaleAnimation.RELATIVE_TO_SELF,
            ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(animationListener);

    return scaleAnimation;
}
 
源代码6 项目: SprintNBA   文件: AnimationUtils.java
/**
 * 获取一个放大动画
 *
 * @param durationMillis    时间
 * @param animationListener 监听
 * @return 返回一个放大的效果
 */
public static ScaleAnimation getAmplificationAnimation(long durationMillis, Animation.AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f,
            1.0f, ScaleAnimation.RELATIVE_TO_SELF,
            ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(animationListener);
    return scaleAnimation;
}
 
源代码7 项目: Utils   文件: CustomAnim.java
/**
 * get a lessen scale animation
 *
 * @param durationMillis Duration in milliseconds
 * @param listener       the animation listener to be notified
 * @return An animation that controls the lessen scale of an object
 */
public static ScaleAnimation getLessenScaleAnimation(long durationMillis, Animation.AnimationListener listener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f,
            0.0f, ScaleAnimation.RELATIVE_TO_SELF,
            ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(listener);
    return scaleAnimation;
}
 
源代码8 项目: Utils   文件: CustomAnim.java
/**
 * get a amplification scale animation
 *
 * @param durationMillis Duration in milliseconds
 * @param listener       the animation listener to be notified
 * @return An animation that controls the amplification scale of an object
 */
public static ScaleAnimation getAmplificationAnimation(long durationMillis, Animation.AnimationListener listener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f,
            1.0f, ScaleAnimation.RELATIVE_TO_SELF,
            ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(listener);
    return scaleAnimation;
}
 
源代码9 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个缩放动画
 * @param fromX             动画开始前在 X 坐标
 * @param toX               动画结束后在 X 坐标
 * @param fromY             动画开始前在 Y 坐标
 * @param toY               动画结束后在 Y 坐标
 * @param pivotXType        缩放中心点的 X 坐标类型, 取值范围为 {@link Animation#ABSOLUTE}、
 *                          {@link Animation#RELATIVE_TO_SELF}、{@link Animation#RELATIVE_TO_PARENT}
 * @param pivotXValue       缩放中心点的 X 坐标, 当 pivotXType == ABSOLUTE 时, 表示绝对位置, 否则表示相对位置, 1.0 表示 100%
 * @param pivotYType        缩放中心点的 Y 坐标类型
 * @param pivotYValue       缩放中心点的 Y 坐标
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个缩放动画
 */
public static ScaleAnimation getScaleAnimation(final float fromX, final float toX, final float fromY, final float toY,
                                               final int pivotXType, final float pivotXValue, final int pivotYType, final float pivotYValue,
                                               final long durationMillis, final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType, pivotYValue);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码10 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个缩放动画
 * @param fromX             动画开始前在 X 坐标
 * @param toX               动画结束后在 X 坐标
 * @param fromY             动画开始前在 Y 坐标
 * @param toY               动画结束后在 Y 坐标
 * @param pivotX            缩放中心点的 X 坐标
 * @param pivotY            缩放中心点的 Y 坐标
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个缩放动画
 */
public static ScaleAnimation getScaleAnimation(final float fromX, final float toX, final float fromY, final float toY,
                                               final float pivotX, final float pivotY, final long durationMillis,
                                               final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotX, pivotY);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码11 项目: DevUtils   文件: AnimationUtils.java
/**
 * 获取一个缩放动画
 * @param fromX             动画开始前在 X 坐标
 * @param toX               动画结束后在 X 坐标
 * @param fromY             动画开始前在 Y 坐标
 * @param toY               动画结束后在 Y 坐标
 * @param durationMillis    动画持续时间
 * @param animationListener 动画监听器
 * @return 一个缩放动画
 */
public static ScaleAnimation getScaleAnimation(final float fromX, final float toX, final float fromY, final float toY,
                                               final long durationMillis, final AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY);
    scaleAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        scaleAnimation.setAnimationListener(animationListener);
    }
    return scaleAnimation;
}
 
源代码12 项目: AndroidStudyDemo   文件: AnimationUtil.java
/**
 * 获取一个缩小动画
 *
 * @param durationMillis
 * @param animationListener
 * @return
 */
public static ScaleAnimation getLessenScaleAnimation(long durationMillis, AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, ScaleAnimation.RELATIVE_TO_SELF, ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(animationListener);
    return scaleAnimation;
}
 
源代码13 项目: AndroidStudyDemo   文件: AnimationUtil.java
/**
 * 获取一个放大动画
 *
 * @param durationMillis
 * @param animationListener
 * @return
 */
public static ScaleAnimation getAmplificationAnimation(long durationMillis, AnimationListener animationListener) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, ScaleAnimation.RELATIVE_TO_SELF, ScaleAnimation.RELATIVE_TO_SELF);
    scaleAnimation.setDuration(durationMillis);
    scaleAnimation.setAnimationListener(animationListener);
    return scaleAnimation;
}