Example usage for android.widget RelativeLayout startAnimation

List of usage examples for android.widget RelativeLayout startAnimation

Introduction

In this page you can find the example usage for android.widget RelativeLayout startAnimation.

Prototype

public void startAnimation(Animation animation) 

Source Link

Document

Start the specified animation now.

Usage

From source file:Main.java

public static void startAnimIn(RelativeLayout view) {
    RotateAnimation ra = new RotateAnimation(180, 360, view.getWidth() / 2, view.getHeight());
    ra.setDuration(500);//from   www. jav a  2s  . co m
    ra.setFillAfter(true);
    view.startAnimation(ra);
}

From source file:Main.java

public static void viewShow(RelativeLayout view) {

    RotateAnimation animation = new RotateAnimation(180, 360, view.getWidth() / 2, view.getHeight());
    animation.setDuration(300);//w  ww  .  jav a  2  s .c  o m
    animation.setFillAfter(true);
    view.startAnimation(animation);

}

From source file:Main.java

public static void rotateOutAnimation(RelativeLayout level, long i) {
    RotateAnimation animation = new RotateAnimation(0, 180, level.getWidth() / 2, level.getHeight());
    animation.setFillAfter(true);/* w ww  .jav a2  s .c  om*/
    animation.setDuration(500);
    animation.setStartOffset(i);
    level.startAnimation(animation);
}

From source file:Main.java

public static void rotateInAnimation(RelativeLayout level, long i) {
    RotateAnimation animation = new RotateAnimation(180, 360, level.getWidth() / 2, level.getHeight());
    animation.setFillAfter(true);/*  w  ww  .  j a  v  a 2 s  .  c  o m*/
    animation.setDuration(500);
    animation.setStartOffset(i);
    level.startAnimation(animation);
}

From source file:com.webianks.library.ShowHideAnimation.java

public void animateIn(RelativeLayout view) {
    view.setVisibility(View.VISIBLE);
    Animation anim = AnimationUtils.loadAnimation(view.getContext(), R.anim.pop_in);
    anim.setDuration(300L);//from  w  w w.  jav a  2 s.c o  m
    anim.setInterpolator(INTERPOLATOR);
    view.startAnimation(anim);
}

From source file:com.glabs.homegenie.StartActivity.java

public void hideLogo() {
    _islogovisible = false;/* ww  w . ja  va2  s .co  m*/
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Animation fadeOut = new AlphaAnimation(0.8f, 0);
            fadeOut.setInterpolator(new AccelerateInterpolator()); //and this
            fadeOut.setStartOffset(0);
            fadeOut.setDuration(500);
            //
            AnimationSet animation = new AnimationSet(false); //change to false
            animation.addAnimation(fadeOut);
            animation.setFillAfter(true);
            RelativeLayout ivlogo = (RelativeLayout) findViewById(R.id.logo);
            ivlogo.startAnimation(animation);
        }
    });
}

From source file:com.glabs.homegenie.StartActivity.java

public void showLogo() {
    _islogovisible = true;//from ww  w.ja va 2  s . c  om
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Animation fadeIn = new AlphaAnimation(0, 0.8f);
            fadeIn.setInterpolator(new AccelerateInterpolator()); //and this
            fadeIn.setStartOffset(0);
            fadeIn.setDuration(500);
            //
            AnimationSet animation = new AnimationSet(false); //change to false
            animation.addAnimation(fadeIn);
            animation.setFillAfter(true);
            RelativeLayout ivlogo = (RelativeLayout) findViewById(R.id.logo);
            ivlogo.startAnimation(animation);
        }
    });
}

From source file:com.webianks.library.ShowHideAnimation.java

public void animateOut(final RelativeLayout view) {
    Animation anim = AnimationUtils.loadAnimation(view.getContext(), R.anim.pop_out);
    anim.setInterpolator(INTERPOLATOR_OUT);
    anim.setDuration(250L);/* ww w  .  j  a va  2  s . c o  m*/
    anim.setAnimationListener(new Animation.AnimationListener() {
        public void onAnimationStart(Animation animation) {
            //ScrollAwareFABBehavior.this.mIsAnimatingOut = true;
        }

        public void onAnimationEnd(Animation animation) {
            //ScrollAwareFABBehavior.this.mIsAnimatingOut = false;
            view.setVisibility(View.GONE);
        }

        @Override
        public void onAnimationRepeat(final Animation animation) {
        }
    });
    view.startAnimation(anim);

}

From source file:com.aero2.android.DefaultActivities.SmogMapActivity.java

public void animateExit() {
    RelativeLayout layout = (RelativeLayout) findViewById(R.id.map_layout);
    AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f);
    animation.setFillAfter(true);/*from   w w w  . j ava2 s .  c o m*/
    animation.setDuration(1000);
    //apply the animation ( fade In ) to your LAyout
    layout.startAnimation(animation);

}

From source file:com.aero2.android.DefaultActivities.SmogMapActivity.java

public void fadeSplashScreen() {
    // Set Runnable to remove splash screen just in case
    final Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        @Override/*from  w  w  w  .  ja v  a 2 s  .c  o m*/
        public void run() {
            removeSplashScreen();
        }
    }, 1000);

    if (!permissionJustGranted) {
        RelativeLayout layout = (RelativeLayout) findViewById(R.id.map_layout);
        AlphaAnimation animation = new AlphaAnimation(-2f, 1.0f);
        animation.setFillAfter(true);
        animation.setDuration(1500);

        //apply the animation ( fade In ) to your LAyout
        layout.startAnimation(animation);
    }

}