本文整理汇总了Java中android.view.animation.ScaleAnimation.setFillAfter方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleAnimation.setFillAfter方法的具体用法?Java ScaleAnimation.setFillAfter怎么用?Java ScaleAnimation.setFillAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.ScaleAnimation
的用法示例。
在下文中一共展示了ScaleAnimation.setFillAfter方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doEnterAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public void doEnterAnim(final View contentView, long animDuration) {
if (builder.gravity == Gravity.BOTTOM) {
ValueAnimator enterAnimator = ValueAnimator.ofFloat(contentView.getHeight(), 0);
enterAnimator.setDuration(animDuration);
enterAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
contentView.setTranslationY(value);
}
});
enterAnimator.start();
} else {
ScaleAnimation scaleAnimation = new ScaleAnimation(0F, 1.0F, 0F, 1.0F,
Animation.RELATIVE_TO_PARENT, 0.5F, Animation.RELATIVE_TO_PARENT, 0.5F);
scaleAnimation.setDuration(animDuration);
scaleAnimation.setFillAfter(true);
contentView.startAnimation(scaleAnimation);
}
}
示例2: doExitAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public void doExitAnim(final View contentView, long animDuration) {
if (builder.gravity == Gravity.BOTTOM) {
ValueAnimator exitAnimator = ValueAnimator.ofFloat(0, contentView.getHeight());
exitAnimator.setDuration(animDuration);
exitAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
contentView.setTranslationY(value);
}
});
exitAnimator.start();
} else {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0F, 0.0F, 1.0F, 0.0F,
Animation.RELATIVE_TO_PARENT, 0.5F, Animation.RELATIVE_TO_PARENT, 0.5F);
scaleAnimation.setDuration(animDuration);
scaleAnimation.setFillAfter(true);
contentView.startAnimation(scaleAnimation);
}
}
示例3: onSuccess
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
protected void onSuccess() {
mCardView.removeAllViews();
MediaPlayer.create(mContext, R.raw.shake).start();
initShakeView();
mCardView.addView(mShakeView);
mCardView.setVisibility(View.VISIBLE);
ScaleAnimation animation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setDuration(320);
animation.setFillAfter(true);
mCardView.startAnimation(animation);
mLoadingView.stop();
mLoadingView.setVisibility(View.GONE);
mTvState.setVisibility(View.GONE);
}
示例4: addTextZoomAnimations
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private void addTextZoomAnimations(AnimationSet set) {
ScaleAnimation mScaleAnim = new ScaleAnimation(1, SCALE_AMOUNT, 1f, SCALE_AMOUNT, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mScaleAnim.setDuration(CHARACTER_ANIM_DURATION);
set.addAnimation(mScaleAnim);
ScaleAnimation mScaleDownAnim = new ScaleAnimation(1, SCALE_AMOUNT, 1f, SCALE_AMOUNT, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mScaleDownAnim.setDuration(CHARACTER_ANIM_DURATION);
mScaleDownAnim.setStartOffset(CHARACTER_ANIM_DURATION + 20);
mScaleDownAnim.setFillAfter(true);
set.addAnimation(mScaleDownAnim);
set.setInterpolator(interpolator);
}
示例5: createUpAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
ScaleAnimation createUpAnim() {
ScaleAnimation localScaleAnimation = new ScaleAnimation(1.2F, 1.0F, 1.2F, 1.0F, 1, 0.5F, 1, 0.5F);
localScaleAnimation.setDuration(50L);
localScaleAnimation.setFillEnabled(true);
localScaleAnimation.setFillEnabled(false);
localScaleAnimation.setFillAfter(true);
return localScaleAnimation;
}
示例6: createDownAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
ScaleAnimation createDownAnim() {
ScaleAnimation localScaleAnimation = new ScaleAnimation(1.0F, 1.2F, 1.0F, 1.2F, 1, 0.5F, 1, 0.5F);
localScaleAnimation.setDuration(50L);
localScaleAnimation.setFillEnabled(true);
localScaleAnimation.setFillBefore(false);
localScaleAnimation.setFillAfter(true);
return localScaleAnimation;
}
示例7: scaleBigAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* 放大动画
*
* @param v view
* @param listener listener
*/
static void scaleBigAnim(View v, Animation.AnimationListener listener) {
ScaleAnimation an2 = new ScaleAnimation(0.8f, 1f, 0.8f, 1f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
an2.setDuration(200);
an2.setFillAfter(true);
v.startAnimation(an2);
an2.setAnimationListener(listener);
}
示例8: scaleSmallAnim
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* 缩小动画
*
* @param v view
*/
static void scaleSmallAnim(View v) {
ScaleAnimation an1 = new ScaleAnimation(1f, 0.8f, 1f, 0.8f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
an1.setDuration(200);
an1.setFillAfter(true);
v.startAnimation(an1);
}
示例9: getZoomInAnimation
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private ScaleAnimation getZoomInAnimation(long startOffset, long touchTime) {
ScaleAnimation zoomIn = new ScaleAnimation(SCALE_FACTOR, 1f, SCALE_FACTOR, 1f);
zoomIn.setStartOffset(startOffset+SCALE_DURATION+touchTime);
zoomIn.setDuration(SCALE_DURATION);
zoomIn.setFillAfter(true);
return zoomIn;
}
示例10: onButtonPressed
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private static void onButtonPressed(View button) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1, 0.9f,
1, 0.9f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(100);
scaleAnimation.setFillAfter(true);
button.startAnimation(scaleAnimation);
}
示例11: onButtonReleased
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private static void onButtonReleased(View button) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.9f, 1f,
0.9f, 1f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(100);
scaleAnimation.setFillAfter(true);
button.startAnimation(scaleAnimation);
}
示例12: scale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private Animation scale(){
ScaleAnimation scaleAnimation = new ScaleAnimation(.75F, 1f, .75F, 1f,
Animation.RELATIVE_TO_SELF, .5F, Animation.RELATIVE_TO_SELF, .5F);
scaleAnimation.setDuration(BUTTON_ANIMATION_DURATION);
scaleAnimation.setFillAfter(true);
return scaleAnimation;
}
示例13: init
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private void init()
{
animatorNormal = new ScaleAnimation(scaleFactor, 1f, scaleFactor, 1f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
animatorNormal.setDuration(300);
animatorNormal.setFillAfter(true);
animatorSmaller = new ScaleAnimation(1f, scaleFactor, 1f, scaleFactor,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
animatorSmaller.setDuration(300);
animatorSmaller.setFillAfter(true);
}
示例14: run
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@Override
public void run() {
mShowTip = false;
mTipView.clearAnimation();
ScaleAnimation scaleAnimation = new ScaleAnimation(1, 1, 1, 0,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0f);
scaleAnimation.setDuration(ANIM_TIME);
scaleAnimation.setFillAfter(true);
mTipView.startAnimation(scaleAnimation);
}