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


Java ObjectAnimator.ofFloat方法代码示例

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


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

示例1: createCircularReveal

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Returns an Animator which can animate a clipping circle.
 * <p/>
 * Any shadow cast by the View will respect the circular clip from this animator.
 * <p/>
 * Only a single non-rectangular clip can be applied on a View at any time.
 * Views clipped by a circular reveal animation take priority over
 * {@link View#setClipToOutline(boolean) View Outline clipping}.
 * <p/>
 * Note that the animation returned here is a one-shot animation. It cannot
 * be re-used, and once started it cannot be paused or resumed.
 *
 * @param view        The View will be clipped to the animating circle.
 * @param centerX     The x coordinate of the center of the animating circle.
 * @param centerY     The y coordinate of the center of the animating circle.
 * @param startRadius The starting radius of the animating circle.
 * @param endRadius   The ending radius of the animating circle.
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static SupportAnimator createCircularReveal(View view,
                                                   int centerX, int centerY,
                                                   float startRadius, float endRadius) {

    if (!(view.getParent() instanceof RevealAnimator)) {
        throw new IllegalArgumentException("View must be inside RevealFrameLayout or RevealLinearLayout.");
    }

    RevealAnimator revealLayout = (RevealAnimator) view.getParent();
    revealLayout.attachRevealInfo(new RevealInfo(centerX, centerY, startRadius, endRadius,
            new WeakReference<>(view)));

    if (LOLLIPOP_PLUS) {
        return new SupportAnimatorLollipop(android.view.ViewAnimationUtils
                .createCircularReveal(view, centerX, centerY, startRadius, endRadius), revealLayout);
    }

    ObjectAnimator reveal = ObjectAnimator.ofFloat(revealLayout, CLIP_RADIUS,
            startRadius, endRadius);
    reveal.addListener(getRevealFinishListener(revealLayout));

    return new SupportAnimatorPreL(reveal, revealLayout);
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:43,代码来源:ViewAnimationUtils.java

示例2: createAnimation

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    ValueAnimator scaleAnim=ValueAnimator.ofFloat(0.5f,1,0.5f);
    scaleAnim.setDuration(1000);
    scaleAnim.setRepeatCount(-1);
    scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            scaleFloat = (float) animation.getAnimatedValue();
            postInvalidate();
        }
    });
    scaleAnim.start();

    ObjectAnimator rotateAnim=ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
    rotateAnim.setDuration(1000);
    rotateAnim.setRepeatCount(-1);
    rotateAnim.start();

    animators.add(scaleAnim);
    animators.add(rotateAnim);
    return animators;
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:25,代码来源:BallRotateIndicator.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:xiangyunwan,项目名称:AndroidSweetSheet-master,代码行数:20,代码来源:Delegate.java

示例4: startDiscAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startDiscAnimator(float animatedValue) {
    mDiscLayoutAnimator = ObjectAnimator.ofFloat(mDiscLayout, "rotation", animatedValue, 360 + animatedValue);
    mDiscLayoutAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator arg0) {
            mDiscLayoutAnimatorValue = (Float) arg0.getAnimatedValue();
        }
    });
    mDiscLayoutAnimator.setDuration(DISC_ANIMATOR_TIME);
    mDiscLayoutAnimator.setRepeatCount(DISC_ANIMATOR_REPEAT_COUNT);
    mDiscLayoutAnimator.setInterpolator(new LinearInterpolator());

    if (mDiscLayoutAnimator.isRunning() || mDiscLayoutAnimator.isStarted()) {
        mDiscLayoutAnimator.cancel();
    }

    mDiscLayoutAnimator.start();
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:20,代码来源:PlayerDiscView.java

示例5: animateView

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void animateView(final ViewGroup parent, final View view) {
    if (mAnimationStartMillis == -1) {
        mAnimationStartMillis = System.currentTimeMillis();
    }

    ViewHelper.setAlpha(view, 0);

    Animator[] childAnimators;
    if (mDecoratedBaseAdapter instanceof AnimationAdapter) {
        childAnimators = ((AnimationAdapter) mDecoratedBaseAdapter).getAnimators(parent, view);
    } else {
        childAnimators = new Animator[0];
    }
    Animator[] animators = getAnimators(parent, view);
    Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

    AnimatorSet set = new AnimatorSet();
    set.playTogether(concatAnimators(childAnimators, animators, alphaAnimator));
    set.setStartDelay(calculateAnimationDelay());
    set.setDuration(getAnimationDurationMillis());
    set.start();

    mAnimators.put(view.hashCode(), set);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:25,代码来源:AnimationAdapter.java

示例6: rotateY

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Animates transition between current  rotateY to target rotateY
 *
 * @param rotationY
 * @param duration
 * @param interpolator
 * @param isFrom
 * @return
 */
@NonNull
public Animator rotateY(float rotationY, float duration, @Nullable Interpolator interpolator, boolean isFrom) {

    Animator animator;
    if (isFrom) {
        animator = ObjectAnimator.ofFloat(mView, "rotationY", rotationY, ViewHelper.getRotationX(mView));
    } else {
        animator = ObjectAnimator.ofFloat(mView, "rotationY", ViewHelper.getRotationX(mView), rotationY);
    }


    setProperties(animator, duration, interpolator);

    return animator;
}
 
开发者ID:canyinghao,项目名称:CanAnimation,代码行数:25,代码来源:CanObjectAnimator.java

示例7: getBottomLinesAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private ObjectAnimator getBottomLinesAnimator(float destBottomLines) {
  if (bottomLinesAnimator == null) {
    bottomLinesAnimator = ObjectAnimator.ofFloat(this, "currentBottomLines", destBottomLines);
  } else {
    bottomLinesAnimator.cancel();
    bottomLinesAnimator.setFloatValues(destBottomLines);
  }
  return bottomLinesAnimator;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:MaterialAutoCompleteTextView.java

示例8: 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

示例9: 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

示例10: getLabelAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private ObjectAnimator getLabelAnimator() {
  if (labelAnimator == null) {
    labelAnimator = ObjectAnimator.ofFloat(this, "floatingLabelFraction", 0f, 1f);
  }
  labelAnimator.setDuration(floatingLabelAnimating ? 300 : 0);
  return labelAnimator;
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:8,代码来源:MaterialEditText.java

示例11: startErrorMultilineAnimator

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startErrorMultilineAnimator(float destLines) {
    if (errorLabelAnimator == null) {
        errorLabelAnimator = ObjectAnimator.ofFloat(this, "currentNbErrorLines", destLines);

    } else {
        errorLabelAnimator.setFloatValues(destLines);
    }
    errorLabelAnimator.start();
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:10,代码来源:MaterialSpinner.java

示例12: createTranslationAnimations

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 创建移动动画
 * 
 * @param view
 * @param startX
 * @param endX
 * @param startY
 * @param endY
 * @return
 */
private AnimatorSet createTranslationAnimations(View view, float startX,
		float endX, float startY, float endY) {
	ObjectAnimator animX = ObjectAnimator.ofFloat(view, "translationX",
			startX, endX);
	ObjectAnimator animY = ObjectAnimator.ofFloat(view, "translationY",
			startY, endY);
	AnimatorSet animSetXY = new AnimatorSet();
	animSetXY.playTogether(animX, animY);
	return animSetXY;
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:21,代码来源:DragGridView.java

示例13: DiscPageChanger

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
public DiscPageChanger(ViewPager viewPager, ImageView needle) {
    mViewPager = viewPager;
    mNeedle = needle;

    mAnimator = ObjectAnimator.ofFloat(needle, "rotation", START_VALUE, END_VALUE);
    mAnimator.setDuration(200);
    mAnimator.setInterpolator(new LinearInterpolator());
    mAnimator.addListener(this);

    playlist = PlayerManager.getInstance(needle.getContext()).getPlaylist();
}
 
开发者ID:piyell,项目名称:NeteaseCloudMusic,代码行数:12,代码来源:DiscPageChanger.java

示例14: 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:JianxunRao,项目名称:FangYanShuo,代码行数:8,代码来源:ButtonFloat.java

示例15: onRefreshing

import com.nineoldandroids.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void onRefreshing() {
    mRefreshLoadView.setPivotX(0.5f * mRefreshLoadView.getMeasuredWidth());
    mRefreshLoadView.setPivotY(0.5f * mRefreshLoadView.getMeasuredHeight());
    if (animator == null) {
        animator = ObjectAnimator.ofFloat(mRefreshLoadView, "rotation", 0.0f, 360.0f);
        animator.setDuration(1000);
        animator.setRepeatCount(ValueAnimator.INFINITE);
        animator.setRepeatMode(ValueAnimator.RESTART);
    }
    if (animator.isRunning()) animator.cancel();
    animator.start();
}
 
开发者ID:NEYouFan,项目名称:ht-refreshrecyclerview,代码行数:14,代码来源:DotStyleVerticalUpRefreshViewHolder.java


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