@Override public void start() { mAnimator.start(); } }
@Override public void start() { mAnimator.start(); } }
@Override public void start() { mAnimator.start(); } }
@Override public void start() { mAnimator.start(); } }
@Override public void onAnimationEnd(Animator animation) { fragmentContainer.setVisibility(View.VISIBLE); mCircularReveal.start(); }
@Override public void onResume() { super.onResume(); if (spruceAnimator != null) { spruceAnimator.start(); } }
@Override public void onResume() { super.onResume(); if (spruceAnimator != null) { spruceAnimator.start(); } }
private void circularRevealActivity() { int cx = rootLayout.getWidth() / 2; int cy = rootLayout.getHeight() / 2; float finalRadius = Math.max(rootLayout.getWidth(), rootLayout.getHeight()); // create the animator for this view (the start radius is zero) Animator circularReveal = ViewAnimationUtils.createCircularReveal(rootLayout, cx, cy, 0, finalRadius); circularReveal.setDuration(1000); // make the view visible and start the animation rootLayout.setVisibility(View.VISIBLE); circularReveal.start(); }
public static void start(Animator animator) { if (animator != null && !animator.isStarted()) { animator.start(); } }
private void startAnimationActually() { ArrayList<Animator> animators = mAnimators; int N = animators.size(); for (int i = 0; i < N; i++) { Animator animator = animators.get(i); if (!animator.isRunning()) { animator.start(); } } }
public void start() { if (mAnimationStarted) { return; } if (animator == null || animatorSet == null) { mRing.reset(); buildAnimator(); } animator.start(); animatorSet.start(); mAnimationStarted = true; mIsAnimatorCancel = false; }
private void addLeaf(float progress, RectF leafFlyRect) { if (progress < mNextLeafCreateThreshold) { return; } mNextLeafCreateThreshold += LEAF_CREATE_DURATION_INTERVAL; LeafHolder leafHolder = new LeafHolder(); mLeafHolders.add(leafHolder); Animator leafAnimator = getAnimator(leafHolder, leafFlyRect, progress); leafAnimator.addListener(new AnimEndListener(leafHolder)); leafAnimator.start(); }
private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) { this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music; View view = findViewById(R.id.content_frame); int finalRadius = Math.max(view.getWidth(), view.getHeight()); Animator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius); animator.setInterpolator(new AccelerateInterpolator()); animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION); findViewById(R.id.content_overlay).setBackground(new BitmapDrawable(getResources(), screenShotable.getBitmap())); animator.start(); ContentFragment contentFragment = ContentFragment.newInstance(this.res); getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit(); return contentFragment; }
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { mAdapter.onBindViewHolder(holder, position); int adapterPosition = holder.getAdapterPosition(); if (!isFirstOnly || adapterPosition > mLastPosition) { for (Animator anim : getAnimators(holder.itemView)) { anim.setDuration(mDuration).start(); anim.setInterpolator(mInterpolator); } mLastPosition = adapterPosition; } else { ViewHelper.clear(holder.itemView); } }
@Test public void normal() { Animator animator = ViewAnimationUtils.createCircularReveal(view, 10, 10, 10f, 100f); animator.addListener(listener); animator.start(); assertThat(listener.startCount).isEqualTo(1); assertThat(listener.endCount).isEqualTo(1); }
@Test public void delayed() { Animator animator = ViewAnimationUtils.createCircularReveal(view, 10, 10, 10f, 100f); animator.setStartDelay(1000); animator.addListener(listener); animator.start(); assertThat(listener.startCount).isEqualTo(1); assertThat(listener.endCount).isEqualTo(1); }
void revealPostingProgress() { Animator reveal = ViewAnimationUtils.createCircularReveal(fabPosting, (int) fabPosting.getPivotX(), (int) fabPosting.getPivotY(), 0f, fabPosting.getWidth() / 2) .setDuration(600L); reveal.setInterpolator(AnimUtils.getFastOutLinearInInterpolator(this)); reveal.start(); AnimatedVectorDrawable uploading = (AnimatedVectorDrawable) getDrawable(R.drawable.avd_uploading); if (uploading != null) { fabPosting.setImageDrawable(uploading); uploading.start(); } }
@Test public void canceled() { Animator animator = ViewAnimationUtils.createCircularReveal(view, 10, 10, 10f, 100f); animator.addListener(listener); Robolectric.getForegroundThreadScheduler().pause(); animator.start(); animator.cancel(); assertThat(listener.startCount).isEqualTo(1); assertThat(listener.cancelCount).isEqualTo(1); assertThat(listener.endCount).isEqualTo(1); }
@Test public void doubleCanceled() { Animator animator = ViewAnimationUtils.createCircularReveal(view, 10, 10, 10f, 100f); animator.addListener(listener); Robolectric.getForegroundThreadScheduler().pause(); animator.start(); animator.cancel(); animator.cancel(); assertThat(listener.startCount).isEqualTo(1); assertThat(listener.cancelCount).isEqualTo(1); assertThat(listener.endCount).isEqualTo(1); }
@Test public void doubleEnded() { Animator animator = ViewAnimationUtils.createCircularReveal(view, 10, 10, 10f, 100f); animator.addListener(listener); Robolectric.getForegroundThreadScheduler().pause(); animator.start(); animator.end(); animator.end(); assertThat(listener.startCount).isEqualTo(1); assertThat(listener.endCount).isEqualTo(1); }