本文整理匯總了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);
}