/** * called when the view is unbound * * @param holder */ @Override public void unbindView(VH holder) { holder.itemView.clearAnimation(); }
@Override public void onAnimationEnd(Animation animation) { view.clearAnimation(); }
@Override public int onFinish(@NonNull RefreshLayout layout, boolean success) { final View thisView = this; isRefreshing = false; thisView.clearAnimation(); return 0; }
protected void disableViewAnimation(View view) { view.clearAnimation(); }
public void stopAnimation(View v) { v.clearAnimation(); if (canCancelAnimation()) { v.animate().cancel(); } }
private ItemListFragment fadeIn(final View view, final boolean animate) { if (view != null) { if (animate) { view.startAnimation(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in)); } else { view.clearAnimation(); } } return this; }
private void prepareForBackgroundColorAnimation(int newColor) { outerContainer.clearAnimation(); backgroundOverlay.clearAnimation(); backgroundOverlay.setBackgroundColor(newColor); backgroundOverlay.setVisibility(View.VISIBLE); }
@Override public int onFinish(@NonNull RefreshLayout layout, boolean success) { final View thisView = this; thisView.clearAnimation(); if (success) { thisView.startAnimation(new Animation() {{ super.setDuration(100); super.setInterpolator(new AccelerateInterpolator()); } @Override protected void applyTransformation(float interpolatedTime, Transformation t) { if (interpolatedTime == 1) { isRefreshing = false; } mFinishTransformation = interpolatedTime; thisView.invalidate(); } }); return 200; } else { isRefreshing = false; return 0; } }
@Override public int onFinish(@NonNull RefreshLayout layout, boolean success) { final View circleView = mCircleView; Animation scaleDownAnimation = new Animation() { @Override public void applyTransformation(float interpolatedTime, Transformation t) { circleView.setScaleX(1 - interpolatedTime); circleView.setScaleY(1 - interpolatedTime); } }; scaleDownAnimation.setDuration(200); mCircleView.setAnimationListener(new Animation.AnimationListener() { public void onAnimationStart(Animation animation) {} public void onAnimationRepeat(Animation animation) {} public void onAnimationEnd(Animation animation) { mProgress.stop(); mProgress.setAlpha(0xff); mWaveView.startDisappearCircleAnimation(); } }); circleView.clearAnimation(); circleView.startAnimation(scaleDownAnimation); return 0; }
/** * Always clears the current animation on the view using * {@link android.view.View#clearAnimation()}, then starts the * {@link android.view.animation.Animation} given in the constructor using * {@link android.view.View#startAnimation(android.view.animation.Animation)} and then returns * {@code false} because the animation does not actually put the current resource on the view. * * @param current {@inheritDoc} * @param adapter {@inheritDoc} * @return {@inheritDoc} */ @Override public boolean transition(R current, ViewAdapter adapter) { View view = adapter.getView(); if (view != null) { view.clearAnimation(); Animation animation = viewTransitionAnimationFactory.build(view.getContext()); view.startAnimation(animation); } return false; }
@Override public void onAnimationEnd(Animation animation) { view.clearAnimation(); view.setVisibility(View.INVISIBLE); if (position == viewList.size() - 1) { animatorListener.enableHomeButton(); drawerLayout.closeDrawers(); } }
private static void setAlpha(View view, float alphaValue){ if(alphaValue == 1){ view.clearAnimation(); }else{ AlphaAnimation alpha = new AlphaAnimation(alphaValue, alphaValue); alpha.setDuration(0); // Make animation instant alpha.setFillAfter(true); // Tell it to persist after the animation ends view.startAnimation(alpha); } }
public void onCreate(Bundle savedInstanceState) { final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible animation.setDuration(500); // duration - half a second animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the end so the button will fade back in final Button btn = (Button) findViewById(R.id.your_btn); btn.startAnimation(animation); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(final View view) { view.clearAnimation(); } }); }
@Override public void addContentView(View view, LayoutParams params) { if (animationDisabled()) { view.clearAnimation(); } super.addContentView(view, params); }
@Override public void setContentView(View view) { if (animationDisabled()) { view.clearAnimation(); } super.setContentView(view); }
@Override public void setContentView(View view, LayoutParams params) { if (animationDisabled()) { view.clearAnimation(); } super.setContentView(view, params); }
@Override public void destroyItem(ViewGroup container, int position, Object object) { Fragment fragment = (Fragment) object; if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } if (DEBUG) Log.v(TAG, "Removing item #" + position + ": f=" + object + " v=" + ((Fragment)object).getView()); while (mSavedState.size() <= position) { mSavedState.add(null); } mSavedState.set(position, fragment.isAdded() ? mFragmentManager.saveFragmentInstanceState(fragment) : null); mFragments.set(position, null); try { fragment.getView().clearAnimation(); } catch (Exception e) { e.printStackTrace(); } mCurTransaction.remove(fragment); }
@Override public void stop() { mParent.clearAnimation(); mRing.setColorIndex(0); mRing.resetOriginals(); showArrow(false); setRotation(0); }
@Override public void stop() { mParent.clearAnimation(); setRotation(0); mRing.setShowArrow(false); mRing.setColorIndex(0); mRing.resetOriginals(); }
@Override public void stop() { mAnimExcutor.clearAnimation(); setRotation(0); mRing.setShowArrow(false); mRing.setColorIndex(0); mRing.resetOriginals(); }