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


Java ObjectAnimator.setDuration方法代码示例

本文整理汇总了Java中com.nineoldandroids.animation.ObjectAnimator.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAnimator.setDuration方法的具体用法?Java ObjectAnimator.setDuration怎么用?Java ObjectAnimator.setDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nineoldandroids.animation.ObjectAnimator的用法示例。


在下文中一共展示了ObjectAnimator.setDuration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPulseAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public static ObjectAnimator getPulseAnimator(View labelToAnimate,
                                              float decreaseRatio, float increaseRatio) {
    Keyframe k0 = Keyframe.ofFloat(0f, 1f);
    Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio);
    Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio);
    Keyframe k3 = Keyframe.ofFloat(1f, 1f);

    PropertyValuesHolder scaleX = PropertyValuesHolder.ofKeyframe("scaleX",
            k0, k1, k2, k3);
    PropertyValuesHolder scaleY = PropertyValuesHolder.ofKeyframe("scaleY",
            k0, k1, k2, k3);
    ObjectAnimator pulseAnimator = ObjectAnimator.ofPropertyValuesHolder(
            labelToAnimate, scaleX, scaleY);
    pulseAnimator.setDuration(PULSE_ANIMATOR_DURATION);

    return pulseAnimator;
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:18,代码来源:Utils.java

示例2: showShowdown

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 显示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    if(mBg.getParent()!= null){
        mParentVG.removeView(mBg);
    }

    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
开发者ID:duguju,项目名称:MousePaintYzz,代码行数:21,代码来源:Delegate.java

示例3: dismissShowdown

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 隐藏模糊背景
 */
protected void dismissShowdown() {

    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 1, 0);
    objectAnimator.setDuration(400);
    objectAnimator.start();
    objectAnimator.addListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animator animation) {

            mParentVG.removeView(mBg);
        }


    });
}
 
开发者ID:duguju,项目名称:MousePaintYzz,代码行数:20,代码来源:Delegate.java

示例4: getPulseAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio, float increaseRatio) {
    Keyframe k0 = Keyframe.ofFloat(0f, 1f);
    Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio);
    Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio);
    Keyframe k3 = Keyframe.ofFloat(1f, 1f);

    PropertyValuesHolder scaleX = PropertyValuesHolder.ofKeyframe("scaleX", k0, k1, k2, k3);
    PropertyValuesHolder scaleY = PropertyValuesHolder.ofKeyframe("scaleY", k0, k1, k2, k3);
    ObjectAnimator pulseAnimator = ObjectAnimator.ofPropertyValuesHolder(labelToAnimate, scaleX, scaleY);
    pulseAnimator.setDuration(PULSE_ANIMATOR_DURATION);

    return pulseAnimator;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:Utils.java

示例5: animateCheck

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (iSchecked) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:13,代码来源:Switch.java

示例6: runEnterAnimation

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * The enter animation scales the picture in from its previous thumbnail
 * size/location, colorizing it in parallel. In parallel, the background of the
 * activity is fading in. When the pictue is in place, the text description
 * drops down.
 */
private void runEnterAnimation() {
  final long duration = ANIM_DURATION;

  // Set starting values for properties we're going to animate. These
  // values scale and position the full size version down to the thumbnail
  // size/location, from which we'll animate it back up
  ViewHelper.setPivotX(mViewPager, 0);
  ViewHelper.setPivotY(mViewPager, 0);
  ViewHelper.setScaleX(mViewPager, (float) thumbnailWidth / mViewPager.getWidth());
  ViewHelper.setScaleY(mViewPager, (float) thumbnailHeight / mViewPager.getHeight());
  ViewHelper.setTranslationX(mViewPager, thumbnailLeft);
  ViewHelper.setTranslationY(mViewPager, thumbnailTop);

  // Animate scale and translation to go from thumbnail to full size
  ViewPropertyAnimator.animate(mViewPager)
      .setDuration(duration)
      .scaleX(1)
      .scaleY(1)
      .translationX(0)
      .translationY(0)
      .setInterpolator(new DecelerateInterpolator());

  // Fade in the black background
  ObjectAnimator bgAnim = ObjectAnimator.ofInt(mViewPager.getBackground(), "alpha", 0, 255);
  bgAnim.setDuration(duration);
  bgAnim.start();

  // Animate a color filter to take the image from grayscale to full color.
  // This happens in parallel with the image scaling and moving into place.
  ObjectAnimator colorizer = ObjectAnimator.ofFloat(ImagePagerFragment.this,
      "saturation", 0, 1);
  colorizer.setDuration(duration);
  colorizer.start();

}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:42,代码来源:ImagePagerFragment.java

示例7: createAnimation

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    ObjectAnimator rotateAnim=ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
    rotateAnim.setDuration(600);
    rotateAnim.setRepeatCount(-1);
    rotateAnim.start();
    animators.add(rotateAnim);
    return animators;
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:11,代码来源:SemiCircleSpinIndicator.java

示例8: animation

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void animation(MenuVH menuVH) {

        ViewHelper.setAlpha(menuVH.itemView, 0);

        ViewHelper.setTranslationY(menuVH.itemView, 300);
        ObjectAnimator translationY = ObjectAnimator.ofFloat(menuVH.itemView, "translationY", 500, 0);
        translationY.setDuration(300);
        translationY.setInterpolator(new OvershootInterpolator(1.6f));
        ObjectAnimator alphaIn = ObjectAnimator.ofFloat(menuVH.itemView, "alpha", 0, 1);
        alphaIn.setDuration(100);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(translationY, alphaIn);
        animatorSet.setStartDelay(30 * menuVH.getAdapterPosition());
        animatorSet.start();
    }
 
开发者ID:duguju,项目名称:MousePaintYzz,代码行数:16,代码来源:MenuRVAdapter.java

示例9: animateCheck

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (eventCheck) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
开发者ID:shegang,项目名称:meishiDemo,代码行数:13,代码来源:Switch.java

示例10: show

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void show(){
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", showPosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	isShow = true;
}
 
开发者ID:shegang,项目名称:meishiDemo,代码行数:8,代码来源:ButtonFloat.java

示例11: onSelectChanged

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void onSelectChanged(View v,boolean selected) {
    float end = selected?180f:0f;
    ObjectAnimator flipAnimator = ObjectAnimator.ofFloat(v,"rotationY",end);
    flipAnimator.setDuration(400);
    flipAnimator.setInterpolator(new DecelerateInterpolator());
    flipAnimator.start();
}
 
开发者ID:peng8350,项目名称:JPTabBar,代码行数:9,代码来源:FlipAnimater.java

示例12: hide

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void hide(){
	
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", hidePosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	
	isShow = false;
}
 
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:10,代码来源:ButtonFloat.java

示例13: showShowdown

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 显示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
开发者ID:xiangyunwan,项目名称:AndroidSweetSheet-master,代码行数:16,代码来源:Delegate.java

示例14: alphaShow

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void alphaShow(boolean isAnimation){

        if(isAnimation) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0, 1);
            objectAnimator.setDuration(300);
            objectAnimator.start();
        }else{
            ViewHelper.setAlpha(this,1);
        }
    }
 
开发者ID:duguju,项目名称:MousePaintYzz,代码行数:11,代码来源:IndicatorView.java

示例15: alphaDismiss

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public void alphaDismiss(boolean isAnimation){
    if(isAnimation) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 1, 0);
        objectAnimator.setDuration(300);
        objectAnimator.start();
    }else{
        ViewHelper.setAlpha(this,0);
    }
}
 
开发者ID:xiangyunwan,项目名称:AndroidSweetSheet-master,代码行数:10,代码来源:IndicatorView.java


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