本文整理汇总了Java中android.view.animation.AnimationSet.setInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationSet.setInterpolator方法的具体用法?Java AnimationSet.setInterpolator怎么用?Java AnimationSet.setInterpolator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.AnimationSet
的用法示例。
在下文中一共展示了AnimationSet.setInterpolator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startShowContinueIconAnimations
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private AnimationSet startShowContinueIconAnimations() {
Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
Animation mRotateAnimation = new RotateAnimation(
0, 360,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
);
mRotateAnimation.setRepeatCount(0);
AnimationSet mAnimations = new AnimationSet(true);
mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
mAnimations.setFillAfter(true);
mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
mAnimations.addAnimation(mScaleAnimation);
mAnimations.addAnimation(mRotateAnimation);
mContinueIcon.startAnimation(mAnimations);
return mAnimations;
}
示例2: animateUp
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
/**
* BottomSheet升起动画
*/
private void animateUp() {
if (mContentView == null) {
return;
}
TranslateAnimation translate = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f
);
AlphaAnimation alpha = new AlphaAnimation(0, 1);
AnimationSet set = new AnimationSet(true);
set.addAnimation(translate);
set.addAnimation(alpha);
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(mAnimationDuration);
set.setFillAfter(true);
mContentView.startAnimation(set);
}
示例3: startAlphaHideAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
public static AnimationSet startAlphaHideAnimation(final View VIEW) {
final int ANIMATION_DURATION = 350;
final Animation mHideViewAnimation = new AlphaAnimation(1f, 0f);
AnimationSet mAnimations = new AnimationSet(true);
mAnimations.setDuration(ANIMATION_DURATION);
mAnimations.setInterpolator(new AccelerateDecelerateInterpolator());
mAnimations.addAnimation(mHideViewAnimation);
mAnimations.setFillAfter(true);
if(VIEW != null)
VIEW.startAnimation(mAnimations);
return mAnimations;
}
示例4: hide
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
public void hide(float x) {
this.lastPositionX = x;
float offset = getOffset(x);
int widthAdjustment = getWidthAdjustment();
AnimationSet animation = new AnimationSet(false);
Animation scaleAnimation = new ScaleAnimation(1, 0.5f, 1, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
Animation translateAnimation = new TranslateAnimation(Animation.ABSOLUTE, offset + widthAdjustment,
Animation.ABSOLUTE, widthAdjustment,
Animation.RELATIVE_TO_SELF, -.25f,
Animation.RELATIVE_TO_SELF, -.25f);
scaleAnimation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
translateAnimation.setInterpolator(new DecelerateInterpolator());
animation.addAnimation(scaleAnimation);
animation.addAnimation(translateAnimation);
animation.setDuration(ANIMATION_DURATION);
animation.setFillBefore(true);
animation.setFillAfter(false);
animation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
recordButtonFab.setVisibility(View.GONE);
recordButtonFab.clearAnimation();
recordButtonFab.startAnimation(animation);
}
示例5: animateButtonIn
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void animateButtonIn(View button, int delay) {
AnimationSet animation = new AnimationSet(true);
Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.addAnimation(scale);
animation.setInterpolator(new OvershootInterpolator(1));
animation.setDuration(ANIMATION_DURATION);
animation.setStartOffset(delay);
button.startAnimation(animation);
}
示例6: createItemDisapperAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
animationSet.setDuration(duration);
animationSet.setInterpolator(new DecelerateInterpolator());
animationSet.setFillAfter(true);
return animationSet;
}
示例7: addTextFadeAnimations
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void addTextFadeAnimations(AnimationSet set) {
AlphaAnimation mFadeInAnim = new AlphaAnimation(1, FADE_MOUNT);
mFadeInAnim.setDuration(CHARACTER_ANIM_DURATION);
set.addAnimation(mFadeInAnim);
AlphaAnimation mFadeOutAnim = new AlphaAnimation(FADE_MOUNT, 1);
mFadeOutAnim.setDuration(CHARACTER_ANIM_DURATION);
mFadeOutAnim.setStartOffset(CHARACTER_ANIM_DURATION + 20);
mFadeOutAnim.setFillAfter(true);
set.addAnimation(mFadeOutAnim);
set.setInterpolator(interpolator);
}
示例8: addTextZoomAnimations
import android.view.animation.AnimationSet; //导入方法依赖的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);
}
示例9: addLoopScaleAnimations
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void addLoopScaleAnimations(long duration, 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(duration);
set.addAnimation(mScaleAnim);
ScaleAnimation mScaleDownAnim = new ScaleAnimation(SCALE_AMOUNT, 1, SCALE_AMOUNT, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mScaleDownAnim.setDuration(duration);
mScaleDownAnim.setStartOffset(duration + 50);
set.addAnimation(mScaleDownAnim);
set.setInterpolator(interpolator);
}
示例10: addLoopFadeAnimations
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void addLoopFadeAnimations(long duration, AnimationSet set) {
AlphaAnimation mFadeInAnim = new AlphaAnimation(1, FADE_MOUNT);
mFadeInAnim.setDuration(duration);
set.addAnimation(mFadeInAnim);
AlphaAnimation mFadeOutAnim = new AlphaAnimation(FADE_MOUNT, 1);
mFadeOutAnim.setDuration(duration);
mFadeOutAnim.setStartOffset(duration + 50);
set.addAnimation(mFadeOutAnim);
set.setInterpolator(interpolator);
}
示例11: getShowAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
protected Animation getShowAnimation() {
AnimationSet set=new AnimationSet(true);
set.setInterpolator(new DecelerateInterpolator());
set.addAnimation(getScaleAnimation(0,1,0,1,Animation.RELATIVE_TO_SELF,1,Animation.RELATIVE_TO_SELF,0));
set.addAnimation(getDefaultAlphaAnimation());
return set;
}
示例12: createItemDisapperAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
animationSet.setDuration(duration);
animationSet.setInterpolator(new DecelerateInterpolator());
animationSet.setFillAfter(true);
return animationSet;
}
示例13: showAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
public Animation showAnimation() {
AnimationSet set = new AnimationSet(true);
Animation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
Animation scaleAnimation = new ScaleAnimation(0.1f, 1f, 0.1f, 1f, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
set.setDuration(200);
set.setInterpolator(new DecelerateInterpolator());
set.addAnimation(alphaAnimation);
set.addAnimation(scaleAnimation);
return set;
}
示例14: hideAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation hideAnimation() {
AnimationSet set = new AnimationSet(true);
Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
Animation scaleAnimation = new ScaleAnimation(1.0f, 0.1f, 1.0f, 0.1f, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
set.setDuration(200);
set.setInterpolator(new DecelerateInterpolator());
set.addAnimation(alphaAnimation);
set.addAnimation(scaleAnimation);
return set;
}
示例15: setInterpolator
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
/**
* Sets interpolator to AnimationSet object.
*
* @param interpolator - string value, responsible for setting concrete interpolator to AnimationSet object.
* @return AnimationSet object with applied interpolator.
*/
private AnimationSet setInterpolator(String interpolator) {
AnimationSet animationSet = new AnimationSet(true);
switch (interpolator) {
case "decelerate":
animationSet.setInterpolator(new DecelerateInterpolator(1.0f));
break;
case "accelerate":
animationSet.setInterpolator(new AccelerateInterpolator(1.0f));
break;
case "accelerateDecelerate":
animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
break;
case "anticipate":
animationSet.setInterpolator(new AnticipateInterpolator(1.0f));
break;
case "anticipateOvershoot":
animationSet.setInterpolator(new AnticipateOvershootInterpolator(1.0f));
break;
case "bounce":
animationSet.setInterpolator(new BounceInterpolator());
break;
case "cycle":
animationSet.setInterpolator(new CycleInterpolator(1.0f));
break;
case "overshoot":
animationSet.setInterpolator(new OvershootInterpolator(1.0f));
break;
default:
animationSet.setInterpolator(new LinearInterpolator());
break;
}
return animationSet;
}