library/src/main/java/com/fabianlockhorst/sdm/SlideDownMessage.java
public void show() {
        if (!mIsShown) {
            if (!mIsAdded) {
                mTarget.addView(mToolbarMessageView);
                mIsAdded = true;
            }
            mToolbarMessageView.post(new Runnable() {
                @Override
                public void run() {
                    TranslateAnimation animate = new TranslateAnimation(0, 0, -100, mOffset);
                    animate.setDuration(500);
                    animate.setFillAfter(true);
                    animate.setAnimationListener(new Animation.AnimationListener() {
                        @Override
                        public void onAnimationStart(Animation animation) {
                            mToolbarMessageView.setVisibility(VISIBLE);
                        }

                        @Override
                        public void onAnimationEnd(Animation animation) {
                            if (mLength != -1 && mLength != LENGTH_INDEFINITELY) {
                                new CountDownTimer(mLength, 1000) {
                                    @Override
                                    public void onTick(long l) {
                                        //do nothing
                                    }

                                    @Override
                                    public void onFinish() {
                                        hide();
                                    }
                                }.start();
                            }
                        }

                        @Override
                        public void onAnimationRepeat(Animation animation) {

                        }
                    });
                    mToolbarMessageView.startAnimation(animate);
                    mIsShown = true;
                }
            });
        }
    }
/**
     * Display SlideDownMessage with animation.
     * if a Length is set other then <code>LENGTH_INDEFINITELY</code>
     * or default length is used SlideDownMessage will automatically hide itself
     */
Display SlideDownMessage with animation.
if a Length is set other then LENGTH_INDEFINITELY
or default length is used SlideDownMessage will automatically hide itself
Display SlideDownMessage with animation . if a Length is set other then LENGTH_INDEFINITELY or default length is used SlideDownMessage will automatically hide itself
public void show() {
        if (!mIsShown) {
            if (!mIsAdded) {
                mTarget.addView(mToolbarMessageView);
                mIsAdded = true;
            }
            mToolbarMessageView.post(new Runnable() {
                @Override
                public void run() {
                    TranslateAnimation animate = new TranslateAnimation(0, 0, -100, mOffset);
                    animate.setDuration(500);
                    animate.setFillAfter(true);
                    animate.setAnimationListener(new Animation.AnimationListener() {
                        @Override
                        public void onAnimationStart(Animation animation) {
                            mToolbarMessageView.setVisibility(VISIBLE);
                        }
                        @Override
                        public void onAnimationEnd(Animation animation) {
                            if (mLength != -1 && mLength != LENGTH_INDEFINITELY) {
                                new CountDownTimer(mLength, 1000) {
                                    @Override
                                    public void onTick(long l) {
                                    }
                                    @Override
                                    public void onFinish() {
                                        hide();
                                    }
                                }.start();
                            }
                        }
                        @Override
                        public void onAnimationRepeat(Animation animation) {
                        }
                    });
                    mToolbarMessageView.startAnimation(animate);
                    mIsShown = true;
                }
            });
        }
    }
public void show ( ) { if ( ! mIsShown ) { if ( ! mIsAdded ) { mTarget . addView ( mToolbarMessageView ) ; mIsAdded = true ; } mToolbarMessageView . post ( new Runnable ( ) { @ Override public void run ( ) { TranslateAnimation animate = new TranslateAnimation ( 0 , 0 , - 100 , mOffset ) ; animate . setDuration ( 500 ) ; animate . setFillAfter ( true ) ; animate . setAnimationListener ( new Animation . AnimationListener ( ) { @ Override public void onAnimationStart ( Animation animation ) { mToolbarMessageView . setVisibility ( VISIBLE ) ; } @ Override public void onAnimationEnd ( Animation animation ) { if ( mLength != - 1 && mLength != LENGTH_INDEFINITELY ) { new CountDownTimer ( mLength , 1000 ) { @ Override public void onTick ( long l ) { } @ Override public void onFinish ( ) { hide ( ) ; } } . start ( ) ; } } @ Override public void onAnimationRepeat ( Animation animation ) { } } ) ; mToolbarMessageView . startAnimation ( animate ) ; mIsShown = true ; } } ) ; } }
Display SlideDownMessage with animation.
Display SlideDownMessage with animation .
//do nothing