本文整理汇总了Java中android.view.animation.ScaleAnimation.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleAnimation.setDuration方法的具体用法?Java ScaleAnimation.setDuration怎么用?Java ScaleAnimation.setDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.ScaleAnimation
的用法示例。
在下文中一共展示了ScaleAnimation.setDuration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hide
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* Hides the FAB.
*/
@Override
public void hide() {
// Only use scale animation if FAB is visible
if (getVisibility() == View.VISIBLE) {
// Pivots indicate where the animation begins from
float pivotX = getPivotX() + getTranslationX();
float pivotY = getPivotY() + getTranslationY();
// Animate FAB shrinking
ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, pivotX, pivotY);
anim.setDuration(FAB_ANIM_DURATION);
anim.setInterpolator(getInterpolator());
startAnimation(anim);
}
setVisibility(View.INVISIBLE);
}
示例2: 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);
}
}
示例3: ScaleLoadingLayout
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public ScaleLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
/**创建缩放动画动画*/
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
// mContentLayout.setSca(ScaleType.MATRIX);
// mHeaderImageMatrix = new Matrix();
// mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mScalAnimation = new ScaleAnimation(BASE_SCALE, 1, Animation.RELATIVE_TO_SELF, BASE_SCALE, Animation.RELATIVE_TO_SELF,
1);
mScalAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mScalAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mScalAnimation.setRepeatCount(Animation.INFINITE);
mScalAnimation.setRepeatMode(Animation.RESTART);
}
示例4: onCreate
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.whats_door);
mLeft = (ImageView)findViewById(R.id.imageLeft);
mRight = (ImageView)findViewById(R.id.imageRight);
mText = (TextView)findViewById(R.id.anim_text);
AnimationSet anim = new AnimationSet(true);
TranslateAnimation mytranslateanim = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,-1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim.setDuration(2000);
anim.setStartOffset(800);
anim.addAnimation(mytranslateanim);
anim.setFillAfter(true);
mLeft.startAnimation(anim);
AnimationSet anim1 = new AnimationSet(true);
TranslateAnimation mytranslateanim1 = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,+1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim1.setDuration(1500);
anim1.addAnimation(mytranslateanim1);
anim1.setStartOffset(800);
anim1.setFillAfter(true);
mRight.startAnimation(anim1);
AnimationSet anim2 = new AnimationSet(true);
ScaleAnimation myscaleanim = new ScaleAnimation(1f,3f,1f,3f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
myscaleanim.setDuration(1000);
AlphaAnimation myalphaanim = new AlphaAnimation(1,0.0001f);
myalphaanim.setDuration(1500);
anim2.addAnimation(myscaleanim);
anim2.addAnimation(myalphaanim);
anim2.setFillAfter(true);
mText.startAnimation(anim2);
new Thread(this).start();
}
示例5: reloadQuestionnaire
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@Override
public void reloadQuestionnaire(List<Question> questionList) {
refreshQuestionnaire(questionList);
ScaleAnimation animation =
new ScaleAnimation(
1.15f, 1, 1.15f, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mCardsContainerView.setAnimation(animation);
animation.setDuration(100);
animation.start();
}
示例6: onSizeChanged
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
WIDTH = w;
HEIGHT = h;
scaleAnimation = new ScaleAnimation(1.0f, zoomScale, 1.0f, zoomScale, w / 2, h / 2);
scaleAnimation.setDuration(zoomDuration);
scaleAnimation.setRepeatMode(Animation.REVERSE);
scaleAnimation.setRepeatCount(1);
}
示例7: makeOpenCloseAnimation
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
AnimationSet set = new AnimationSet(false);
ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, 1, 0.5f, 1, 0.5f);
scale.setInterpolator(DECELERATE_QUINT);
scale.setDuration(220);
set.addAnimation(scale);
AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
alpha.setInterpolator(DECELERATE_CUBIC);
alpha.setDuration(220);
set.addAnimation(alpha);
return set;
}
示例8: animationScale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public static void animationScale(View view, float sizeIn, float sizeOut, int duration) {
ScaleAnimation scaleAnimation = new ScaleAnimation(sizeIn, sizeOut, sizeIn, sizeOut,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setDuration(duration);
scaleAnimation.setRepeatMode(Animation.REVERSE);
scaleAnimation.setRepeatCount(Animation.INFINITE);
view.startAnimation(scaleAnimation);
}
示例9: endScale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private ScaleAnimation endScale(int startTime) {
ScaleAnimation scale = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setInterpolator(this, android.R.anim.decelerate_interpolator);
scale.setStartOffset(startTime - 300);
scale.setDuration(300);
return scale;
}
示例10: 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;
}
示例11: getLessenScaleAnimation
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* Get a shrink animation
*
* @param durationMillis duration
* @param animationListener Animation monitor
* @return A shrink animation
*/
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;
}
示例12: scaleAnimateView
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public static void scaleAnimateView(View view) {
ScaleAnimation animation =
new ScaleAnimation(
1.15f, 1, 1.15f, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
view.setAnimation(animation);
animation.setDuration(100);
animation.start();
}
示例13: hide
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public void hide() {
// Only use scale animation if FAB is visible
if (getVisibility() == View.VISIBLE) {
// Pivots indicate where the animation begins from
float pivotX = getPivotX() + getTranslationX();
float pivotY = getPivotY() + getTranslationY();
// Animate FAB shrinking
ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, pivotX, pivotY);
anim.setDuration(FAB_ANIM_DURATION);
anim.setInterpolator(getInterpolator());
startAnimation(anim);
}
setVisibility(View.INVISIBLE);
}
示例14: 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);
}
示例15: startScale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* scale
*/
private void startScale() {
ScaleAnimation scale = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
scale.setDuration(1000);
content.startAnimation(scale);
}