当前位置: 首页>>代码示例>>Java>>正文


Java AnimationSet.setInterpolator方法代码示例

本文整理汇总了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;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:20,代码来源:WelcomeActivity.java

示例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);
}
 
开发者ID:QMUI,项目名称:QMUI_Android,代码行数:21,代码来源:QMUIBottomSheet.java

示例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;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:17,代码来源:AnimationService.java

示例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);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:30,代码来源:MicrophoneRecorderView.java

示例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);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:12,代码来源:AttachmentTypeSelector.java

示例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;
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:13,代码来源:RayMenu.java

示例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);
}
 
开发者ID:HarinTrivedi,项目名称:AnimatedPullToRefresh-master,代码行数:12,代码来源:AnimationHelper.java

示例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);
}
 
开发者ID:HarinTrivedi,项目名称:AnimatedPullToRefresh-master,代码行数:12,代码来源:AnimationHelper.java

示例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);
}
 
开发者ID:HarinTrivedi,项目名称:AnimatedPullToRefresh-master,代码行数:11,代码来源:AnimationHelper.java

示例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);
}
 
开发者ID:HarinTrivedi,项目名称:AnimatedPullToRefresh-master,代码行数:11,代码来源:AnimationHelper.java

示例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;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:9,代码来源:MessageMenuPopup.java

示例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;
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:13,代码来源:ArcMenu.java

示例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;
}
 
开发者ID:fingdo,项目名称:stateLayout,代码行数:13,代码来源:FadeScaleViewAnimProvider.java

示例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;
}
 
开发者ID:fingdo,项目名称:stateLayout,代码行数:14,代码来源:FadeScaleViewAnimProvider.java

示例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;
}
 
开发者ID:RELEX-Group,项目名称:SlidingPanel,代码行数:50,代码来源:SlidingPanelAnimator.java


注:本文中的android.view.animation.AnimationSet.setInterpolator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。