Search in sources :

Example 1 with TranslateAnimation

use of com.jams.music.player.Animations.TranslateAnimation in project JamsMusicPlayer by psaravan.

the class BrowserSubGridActivity method slideAwayHeader.

/**
     *
     */
/**
     * Slides away the header layout.
     */
private void slideAwayHeader() {
    TranslateAnimation slideDown = new TranslateAnimation(mHeaderLayout, 400, new AccelerateInterpolator(2.0f), View.INVISIBLE, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -2.0f);
    slideDown.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mHeaderLayout.setVisibility(View.INVISIBLE);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    slideDown.animate();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(com.jams.music.player.Animations.TranslateAnimation) Animation(android.view.animation.Animation) TranslateAnimation(com.jams.music.player.Animations.TranslateAnimation)

Example 2 with TranslateAnimation

use of com.jams.music.player.Animations.TranslateAnimation in project JamsMusicPlayer by psaravan.

the class PlaylistPagerFragment method hideLyrics.

/**
     * Slides down the album art to hide lyrics.
     */
private void hideLyrics() {
    TranslateAnimation slideDownAnimation = new TranslateAnimation(coverArt, 400, new DecelerateInterpolator(2.0f), View.VISIBLE, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -2.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    slideDownAnimation.animate();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) TranslateAnimation(com.jams.music.player.Animations.TranslateAnimation)

Example 3 with TranslateAnimation

use of com.jams.music.player.Animations.TranslateAnimation in project JamsMusicPlayer by psaravan.

the class BrowserSubListActivity method slideAwayHeader.

/**
     * Slides away the header layout.
     */
private void slideAwayHeader() {
    TranslateAnimation slideDown = new TranslateAnimation(mHeaderLayout, 400, new AccelerateInterpolator(2.0f), View.INVISIBLE, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -2.0f);
    slideDown.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
            mHeaderLayout.setVisibility(View.VISIBLE);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mHeaderLayout.setVisibility(View.INVISIBLE);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    slideDown.animate();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(com.jams.music.player.Animations.TranslateAnimation) Animation(android.view.animation.Animation) TranslateAnimation(com.jams.music.player.Animations.TranslateAnimation)

Aggregations

TranslateAnimation (com.jams.music.player.Animations.TranslateAnimation)3 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 Animation (android.view.animation.Animation)2 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1