Search in sources :

Example 86 with AnimationListener

use of android.view.animation.Animation.AnimationListener in project ListViewCellDeleteAnimation by paraches.

the class MainActivity method deleteCell.

private void deleteCell(final View v, final int index) {
    AnimationListener al = new AnimationListener() {

        @Override
        public void onAnimationEnd(Animation arg0) {
            mAnimList.remove(index);
            ViewHolder vh = (ViewHolder) v.getTag();
            vh.needInflate = true;
            mMyAnimListAdapter.notifyDataSetChanged();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationStart(Animation animation) {
        }
    };
    collapse(v, al);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener)

Example 87 with AnimationListener

use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.

the class EdgeSwipeAppMenuHelper method setBackgroundExitAnimation.

private void setBackgroundExitAnimation() {
    Animation backAnimation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_background_fade_out);
    backAnimation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            backVisible = false;
            menuBackground.setVisibility(View.INVISIBLE);
            menuRoot.setVisibility(View.INVISIBLE);
        }
    });
    menuBackground.startAnimation(backAnimation);
}
Also used : Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener)

Example 88 with AnimationListener

use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.

the class EdgeSwipeAppMenuHelper method setMenuSideExitAnimation.

private void setMenuSideExitAnimation() {
    // draw back the menu
    // load the correct side for the animation
    Animation animation = null;
    if (getCurrentSide() == Side.LEFT) {
        animation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_disappear_to_left_animation);
    } else {
        animation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_disappear_to_right_animation);
    }
    getMenuContainerView().setVisibility(View.VISIBLE);
    contentVisible = true;
    backVisible = true;
    animation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            menuRoot.setVisibility(View.INVISIBLE);
            contentVisible = false;
            if (!backVisible) {
                getMenuContainerView().setVisibility(View.GONE);
            }
        }
    });
    menuContent.startAnimation(animation);
}
Also used : Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener)

Example 89 with AnimationListener

use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.

the class OOBEActivity method stopIntroVideo.

private void stopIntroVideo() {
    mVideo.stopPlayback();
    final RelativeLayout rl = (RelativeLayout) findViewById(R.id.oobeVideoViewGroup);
    Animation fadeOutAnimation = AnimationUtils.loadAnimation(OOBEActivity.this, R.anim.fade_out_slow);
    rl.startAnimation(fadeOutAnimation);
    fadeOutAnimation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            rl.setVisibility(View.GONE);
            mVideo.setVisibility(View.GONE);
            mSkipVideoButton.setVisibility(View.GONE);
        }
    });
    startTutorialInitialAnimation();
}
Also used : RelativeLayout(android.widget.RelativeLayout) Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener)

Example 90 with AnimationListener

use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.

the class EditFavoritesActivity method startViewFadeOutFadeInAnimation.

/**
 * Performs the animation when replacing one favorite
 *
 * @param viewToFadeIn
 *            view that will appear. When null it means that we are swapping
 *            two favorites
 * @param viewToFadeOut
 *            view that will disappear.
 * @param applicationInfo
 *            app info that is used to swap two favorites
 */
private void startViewFadeOutFadeInAnimation(final View viewToFadeIn, final View viewToFadeOut, final ApplicationInfo applicationInfo) {
    Animation fadeOutAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_out_fast);
    fadeOutAnimation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            viewToFadeOut.setVisibility(View.INVISIBLE);
            if (applicationInfo == null && viewToFadeIn != null) {
                if (viewToFadeIn.getVisibility() != View.VISIBLE) {
                    viewToFadeIn.setVisibility(View.VISIBLE);
                    Animation fadeInAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_in_fast);
                    viewToFadeIn.startAnimation(fadeInAnimation);
                }
            } else if (applicationInfo != null) {
                // get the new icon
                updateFavoriteIcon(applicationInfo, (TextView) viewToFadeOut);
                viewToFadeOut.setVisibility(View.VISIBLE);
                Animation fadeInAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_in_fast);
                viewToFadeOut.startAnimation(fadeInAnimation);
            }
        }
    });
    if (viewToFadeOut.getVisibility() == View.VISIBLE) {
        viewToFadeOut.startAnimation(fadeOutAnimation);
    }
}
Also used : Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener)

Aggregations

Animation (android.view.animation.Animation)97 AnimationListener (android.view.animation.Animation.AnimationListener)97 AlphaAnimation (android.view.animation.AlphaAnimation)32 TranslateAnimation (android.view.animation.TranslateAnimation)27 View (android.view.View)15 LinearInterpolator (android.view.animation.LinearInterpolator)12 ScaleAnimation (android.view.animation.ScaleAnimation)11 RotateAnimation (android.view.animation.RotateAnimation)10 ImageView (android.widget.ImageView)10 Rect (android.graphics.Rect)7 ViewGroup (android.view.ViewGroup)6 PopupWindow (android.widget.PopupWindow)6 Window (wei.mark.standout.ui.Window)6 SuppressLint (android.annotation.SuppressLint)5 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)5 AnimationSet (android.view.animation.AnimationSet)4 Interpolator (android.view.animation.Interpolator)4 OvershootInterpolator (android.view.animation.OvershootInterpolator)4 Transformation (android.view.animation.Transformation)4 InputMethodManager (android.view.inputmethod.InputMethodManager)4