Example usage for android.view.animation AlphaAnimation setFillAfter

List of usage examples for android.view.animation AlphaAnimation setFillAfter

Introduction

In this page you can find the example usage for android.view.animation AlphaAnimation setFillAfter.

Prototype

public void setFillAfter(boolean fillAfter) 

Source Link

Document

If fillAfter is true, the transformation that this animation performed will persist when it is finished.

Usage

From source file:com.mina.breathitout.AnalyzeActivity.java

public void fadeInText() {
    AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f);
    AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
    txtView.startAnimation(fadeIn);/*  ww w .j  a v  a2 s. c  o  m*/
    txtView.startAnimation(fadeOut);
    fadeIn.setDuration(4000);
    fadeIn.setFillAfter(true);
    fadeOut.setDuration(4000);
    fadeOut.setFillAfter(true);
    fadeIn.setStartOffset(4200);
}

From source file:com.zhongsou.souyue.activity.SplashActivity.java

private void animationHide(ImageView iv) {
    try {/*from  w  w  w .j  av  a2s. c  o  m*/
        AlphaAnimation ai = new AlphaAnimation(1.0f, 0.0f);
        ai.setDuration(500);
        ai.setFillAfter(true);
        iv.startAnimation(ai);
    } catch (Exception ex) {

    }
}

From source file:com.zhongsou.souyue.activity.SplashActivity.java

private void animationShow(ImageView iv) {
    try {/* w  w  w.  j a va 2s.c om*/
        AlphaAnimation ai = new AlphaAnimation(0.0f, 1.0f);
        ai.setDuration(500);
        ai.setFillAfter(true);
        iv.startAnimation(ai);
    } catch (Exception ex) {

    }
}

From source file:com.xander.panel.PanelController.java

private Animation createBgAnimation(int animType) {
    AlphaAnimation an = null;
    if (ANIM_TYPE_SHOW == animType) {
        an = new AlphaAnimation(0, 1);
    } else {//from  ww  w.  ja va 2  s  . c  o m
        an = new AlphaAnimation(1, 0);
    }
    an.setDuration(DURATION_ALPHA);
    an.setFillAfter(true);
    return an;
}

From source file:com.example.camera360.ui.ImageDetailActivity.java

private void showDetailView(final float p1, final float p2) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(p1, p2);
    alphaAnimation.setDuration(DURATION_MILLIS);
    alphaAnimation.setAnimationListener(new AnimationListener() {
        @Override//from   ww  w  . ja va  2  s  .  c o  m
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mImageDetailView.clearAnimation();
            if (p2 == 0) {
                mImageDetailView.setVisibility(View.INVISIBLE);
            }
            checkStatus();
        }
    });
    mImageDetailView.setAnimation(alphaAnimation);
    alphaAnimation.setFillAfter(true);
}

From source file:com.mina.breathitout.AnalyzeActivity.java

private void moveUp() {
    AnalyzeActivity.this.runOnUiThread(new Runnable() {
        @Override/*from  w w  w  .  j  a  v a2s .  c  o  m*/
        public void run() {
            view.moveUP();
            breathOutView.setVisibility(View.VISIBLE);
            AlphaAnimation fadeIn_breathout = new AlphaAnimation(0.0f, 1.0f);
            fadeIn_breathout.setDuration(2000);
            fadeIn_breathout.setAnimationListener(new Animation.AnimationListener() {
                @Override
                public void onAnimationStart(Animation animation) {

                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    AlphaAnimation fadeOut_breathout = new AlphaAnimation(1.0f, 0.0f);
                    breathOutView.startAnimation(fadeOut_breathout);
                    fadeOut_breathout.setDuration(2000);
                    breathOutView.setVisibility(View.INVISIBLE);
                }

                @Override
                public void onAnimationRepeat(Animation animation) {

                }
            });

            breathOutView.startAnimation(fadeIn_breathout);
            fadeIn_breathout.setFillAfter(true);
            animateProgressBar();
        }
    });
}

From source file:com.irccloud.android.fragment.MessageViewFragment.java

public void showSpinner(boolean show) {
    if (show) {//w  w  w.  jav  a 2 s .c o  m
        if (Build.VERSION.SDK_INT < 16) {
            AlphaAnimation anim = new AlphaAnimation(0, 1);
            anim.setDuration(150);
            anim.setFillAfter(true);
            spinner.setAnimation(anim);
        } else {
            spinner.setAlpha(0);
            spinner.animate().alpha(1);
        }
        spinner.setVisibility(View.VISIBLE);
    } else {
        if (Build.VERSION.SDK_INT < 16) {
            AlphaAnimation anim = new AlphaAnimation(1, 0);
            anim.setDuration(150);
            anim.setFillAfter(true);
            anim.setAnimationListener(new AnimationListener() {
                @Override
                public void onAnimationStart(Animation animation) {

                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    spinner.setVisibility(View.GONE);
                }

                @Override
                public void onAnimationRepeat(Animation animation) {

                }
            });
            spinner.setAnimation(anim);
        } else {
            spinner.animate().alpha(0).withEndAction(new Runnable() {
                @Override
                public void run() {
                    spinner.setVisibility(View.GONE);
                }
            });
        }
    }
}

From source file:com.irccloud.android.activity.MainActivity.java

@Override
public void onMessageViewReady() {
    if (shouldFadeIn) {
        Crashlytics.log(Log.DEBUG, "IRCCloud", "Fade In");
        MessageViewFragment mvf = (MessageViewFragment) getSupportFragmentManager()
                .findFragmentById(R.id.messageViewFragment);
        UsersListFragment ulf = (UsersListFragment) getSupportFragmentManager()
                .findFragmentById(R.id.usersListFragment);

        if (Build.VERSION.SDK_INT < 16) {
            AlphaAnimation anim = new AlphaAnimation(0, 1);
            anim.setDuration(150);//from  w w  w.j  a  v  a 2s .  c  o  m
            anim.setFillAfter(true);
            if (mvf != null && mvf.getListView() != null)
                mvf.getListView().startAnimation(anim);
            if (ulf != null && ulf.getListView() != null)
                ulf.getListView().startAnimation(anim);
        } else {
            if (mvf != null && mvf.getListView() != null)
                mvf.getListView().animate().alpha(1);
            if (ulf != null && ulf.getListView() != null)
                ulf.getListView().animate().alpha(1);
        }
        if (mvf != null && mvf.getListView() != null) {
            if (mvf.buffer != buffer && buffer != null
                    && BuffersDataSource.getInstance().getBuffer(buffer.bid) != null) {
                Bundle b = new Bundle();
                b.putInt("cid", buffer.cid);
                b.putInt("bid", buffer.bid);
                b.putBoolean("fade", false);
                mvf.setArguments(b);
            }
            mvf.showSpinner(false);
        }
        shouldFadeIn = false;
    }
}

From source file:com.xmobileapp.rockplayer.RockPlayer.java

/********************************
 * /*from  w w w  . j a  v a2s  . c o m*/
 * switch between different UI modes
 * 
 ********************************/
public void setNormalView() {
    if (VIEW_STATE == NORMAL_VIEW) {

    } else if (VIEW_STATE == LIST_EXPANDED_VIEW) {
        /*
         * Animate fading of the current playing layout
         */

        /*
         * Put album navigator full screen (this will happen in the end of the animation)
         */
        RelativeLayout.LayoutParams params = (LayoutParams) albumNavigatorLayoutOuter.getLayoutParams();
        params.addRule(RelativeLayout.RIGHT_OF, R.id.songfest_current_playing_container);
        albumNavigatorLayoutOuter.setLayoutParams(params);

        /*
         * Animate growth of the album navigator
         */
        int slideAmount = currentPlayingLayout.getWidth();
        albumNavigatorLayoutOuter.bringToFront();
        TranslateAnimation slideRight = new TranslateAnimation(-slideAmount, 0, 0, 0);
        slideRight.setFillAfter(true);
        slideRight.setDuration(250);
        slideRight.setAnimationListener(slideRightAnimationListener);
        albumNavigatorLayoutOuter.startAnimation(slideRight);

    } else if (VIEW_STATE == FULLSCREEN_VIEW) {

        setBackground();

        AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
        fadeOut.setFillAfter(true);
        fadeOut.setDuration(300);
        this.mainUIContainer.startAnimation(fadeOut);

        showFullScreenHandler.sendEmptyMessageDelayed(VIEW_STATE, 300);

        VIEW_STATE = FULLSCREEN_VIEW;

    }

    VIEW_STATE = NORMAL_VIEW;
    return;
}

From source file:com.xmobileapp.rockplayer.RockPlayer.java

public void setFullScreenView() {

    Log.i("GOGO", "FULL SCREEN");

    hideBackground();/*ww  w . j  a  v  a  2  s  .co  m*/

    AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setFillAfter(true);
    fadeOut.setDuration(300);
    this.mainUIContainer.startAnimation(fadeOut);

    showFullScreenHandler.sendEmptyMessageDelayed(NORMAL_VIEW, 300);

    VIEW_STATE = FULLSCREEN_VIEW;

    if (true)
        return;

    /*
     * Animate fading of the album navigator
     */
    Rotate3dAnimation perspectiveFullLeft = new Rotate3dAnimation(0, 0, // X-axis rotation
            90, 90, // Y-axis rotation
            0, 0, // Z-axis rotation
            100, 100, // rotation center
            0.0f, // Z-depth
            false); //reverse movement
    perspectiveFullLeft.setFillAfter(true);
    perspectiveFullLeft.setDuration(1);
    albumNavigatorList.startAnimation(perspectiveFullLeft);
    //       currentPlayingLayout.startAnimation(perspectiveFullLeft);

    /*
     * Put album navigator full screen
     */
    RelativeLayout.LayoutParams params = (LayoutParams) currentPlayingLayout.getLayoutParams();
    params.width = RelativeLayout.LayoutParams.FILL_PARENT;
    currentPlayingLayout.setLayoutParams(params);

    /*
     * Animate growth of the current playing layout
     */
    //      int fullWidth = display.getWidth();
    ////      int slideAmount = display.getWidth() - albumNavigatorList.getWidth();
    ////      TranslateAnimation slideLeft= new TranslateAnimation(slideAmount, 0, 0, 0);
    //      ScaleAnimation scaleAnim = new ScaleAnimation(0.66f, 1.0f, 1.0f, 1.0f);
    //      scaleAnim.setFillAfter(true);
    //      scaleAnim.setDuration(400);
    //      currentPlayingLayout.startAnimation(scaleAnim);

    //albumNavigatorLayout.setBackgroundColor(Color.WHITE);
    //         
    //         LayoutParams paramsList = (LayoutParams) albumNavigatorList.getLayoutParams();
    //         paramsList.width = display.getWidth();
    //         albumNavigatorList.setLayoutParams(paramsList);

    //      currentPlayingLayout.setVisibility(View.GONE);

    //      if(VIEW_STATE == NORMAL_VIEW){
    //         
    //         
    //         
    //      } else if(VIEW_STATE == LIST_EXPANDED_VIEW) {
    //         
    //      } else if(VIEW_STATE == FULLSCREEN_VIEW){
    //         
    //      }

    VIEW_STATE = FULLSCREEN_VIEW;
}