Refine search
ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progressBar); ObjectAnimator animation = ObjectAnimator.ofInt (progressBar, "progress", 0, 500); // see this max value coming back here, we animale towards that value animation.setDuration (5000); //in milliseconds animation.setInterpolator (new DecelerateInterpolator ()); animation.start ();
ObjectAnimator animation = ObjectAnimator.ofInt( tvText, "maxLines", 25); animation.setDuration(4000); animation.start();
ImageView imageview = (ImageView)findViewById(R.id.image); ObjectAnimator imageViewObjectAnimator = ObjectAnimator.ofFloat(imageview , "rotation", 0f, 360f); imageViewObjectAnimator.setDuration(1000); // miliseconds imageViewObjectAnimator.start();
if(android.os.Build.VERSION.SDK_INT >= 11){ // will update the "progress" propriety of seekbar until it reaches progress ObjectAnimator animation = ObjectAnimator.ofInt(seekbar, "progress", progress); animation.setDuration(500); // 0.5 second animation.setInterpolator(new DecelerateInterpolator()); animation.start(); } else seekbar.setProgress(progress); // no animation on Gingerbread or lower
ObjectAnimator animator=ObjectAnimator.ofInt(yourHorizontalScrollView, "scrollX",targetXScroll ); animator.setDuration(800); animator.start();
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat(TRANSLATION_X, value); PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat(TRANSLATION_Y, value); ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY); animator.setDuration(BASE_DURATION * 2); animator.start();
ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat("scaleX", 0.5f), PropertyValuesHolder.ofFloat("scaleY", 0.5f)); scaleDown.setDuration(1000); scaleDown.start();
ObjectAnimator objectAnimator= ObjectAnimator.ofFloat(mContent_container, "translationX", startX, endX); objectAnimator.setDuration(1000); objectAnimator.start();
/** * 垂直偏移动画 * @param view * @param startY * @param endY * @param duration * @return */ public static Animator doMoveVertical(View view, int startY, int endY, int duration) { ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationY", startY, endY).setDuration(duration); animator.start(); return animator; }
public void reset() { final ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "percent", 1f, 0f); objectAnimator.setDuration(duration); if (interpolator != null) { objectAnimator.setInterpolator(interpolator); } objectAnimator.start(); }
private void showSubMenu() { mSubmenuLayout.setVisibility(VISIBLE); ObjectAnimator animator = ObjectAnimator.ofFloat(mSubmenuLayout, "alpha", 0f, 1f); animator.setDuration(500).start(); } }
private void showSubMenu() { mSubmenuLayout.setVisibility(VISIBLE); ObjectAnimator animator = ObjectAnimator.ofFloat(mSubmenuLayout, "alpha", 0f, 1f); animator.setDuration(200).start(); } }
final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(view, "backgroundColor", new ArgbEvaluator(), 0xFFFFFFFF, 0xff78c5f9); backgroundColorAnimator.setDuration(300); backgroundColorAnimator.start();
void finishSpotlight(long duration, TimeInterpolator animation, AbstractAnimatorListener listener) { ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 1f, 0f); objectAnimator.setDuration(duration); objectAnimator.setInterpolator(animation); objectAnimator.addListener(listener); objectAnimator.start(); }
void startSpotlight(long duration, TimeInterpolator animation, AbstractAnimatorListener listener) { ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0f, 1f); objectAnimator.setDuration(duration); objectAnimator.setInterpolator(animation); objectAnimator.addListener(listener); objectAnimator.start(); }
public void changeDigit(TimelyView tv, int end) { ObjectAnimator obja = tv.animate(end); obja.setDuration(400); obja.start(); }
private void showBubble() { AnimatorSet animatorSet = new AnimatorSet(); bubble.setVisibility(VISIBLE); if (currentAnimator != null) currentAnimator.cancel(); currentAnimator = ObjectAnimator.ofFloat(bubble, "alpha", 0f, 1f).setDuration(BUBBLE_ANIMATION_DURATION); currentAnimator.start(); }
ObjectAnimator colorFade = ObjectAnimator.ofObject(screen, "backgroundColor", new ArgbEvaluator(), Color.argb(255,255,255,255), 0xff000000); colorFade.setDuration(7000); colorFade.start();
ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(mContext, R.animator.flipping); anim.setTarget(A View Object reference goes here i.e. ImageView); anim.setDuration(3000); anim.start();
public void doEndAnim() { mAnimator = ObjectAnimator.ofInt(this, "InnViewPositionX", mInnViewPositionX, mInnCenterPositionX); mAnimator.setDuration(250); mAnimator.start(); } }