Codota Logo
android.view.animation
Code IndexAdd Codota to your IDE (free)

How to use android.view.animation

Best Java code snippets using android.view.animation (Showing top 20 results out of 4,455)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setInterpolator(new DecelerateInterpolator()); //add this
fadeIn.setDuration(1000);

Animation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setInterpolator(new AccelerateInterpolator()); //and this
fadeOut.setStartOffset(1000);
fadeOut.setDuration(1000);

AnimationSet animation = new AnimationSet(false); //change to false
animation.addAnimation(fadeIn);
animation.addAnimation(fadeOut);
this.setAnimation(animation);
origin: bumptech/glide

 @Override
 public Animation build(Context context) {
  return AnimationUtils.loadAnimation(context, animationId);
 }
}
origin: airbnb/lottie-android

LottieInterpolatedValue(T startValue, T endValue) {
 this(startValue, endValue, new LinearInterpolator());
}
origin: aporter/coursera-android

private Animation inFromRightAnimation() {
  Animation inFromRight = new TranslateAnimation(
      Animation.RELATIVE_TO_PARENT, +1.0f,
      Animation.RELATIVE_TO_PARENT, 0.0f,
      Animation.RELATIVE_TO_PARENT, 0.0f,
      Animation.RELATIVE_TO_PARENT, 0.0f);
  inFromRight.setDuration(500);
  inFromRight.setInterpolator(new LinearInterpolator());
  return inFromRight;
}
origin: nostra13/Android-Universal-Image-Loader

  /**
   * Animates {@link ImageView} with "fade-in" effect
   *
   * @param imageView      {@link ImageView} which display image in
   * @param durationMillis The length of the animation in milliseconds
   */
  public static void animate(View imageView, int durationMillis) {
    if (imageView != null) {
      AlphaAnimation fadeImage = new AlphaAnimation(0, 1);
      fadeImage.setDuration(durationMillis);
      fadeImage.setInterpolator(new DecelerateInterpolator());
      imageView.startAnimation(fadeImage);
    }
  }
}
origin: stackoverflow.com

 final Animation in = new AlphaAnimation(0.0f, 1.0f);
in.setDuration(3000);

final Animation out = new AlphaAnimation(1.0f, 0.0f);
out.setDuration(3000);

AnimationSet as = new AnimationSet(true);
as.addAnimation(out);
in.setStartOffset(3000);
as.addAnimation(in);
origin: Bearded-Hen/Android-Bootstrap

private void setupAnimations() {
  fadeInAnimation = new AlphaAnimation(0.0f, 1.0f);
  fadeInAnimation.setDuration(300);
  fadeInAnimation.setInterpolator(new AccelerateInterpolator());
  fadeInAnimation.setAnimationListener(this);
  fadeOutAnimation = new AlphaAnimation(1.0f, 0.0f);
  fadeOutAnimation.setDuration(300);
  fadeOutAnimation.setInterpolator(new AccelerateInterpolator());
  fadeOutAnimation.setAnimationListener(this);
}
origin: stackoverflow.com

 TextView myText = (TextView) findViewById(R.id.myText );

Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50); //You can manage the blinking time with this parameter
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
myText.startAnimation(anim);
origin: ogaclejapan/SmartTabLayout

public SmartIndicationInterpolator(float factor) {
 leftEdgeInterpolator = new AccelerateInterpolator(factor);
 rightEdgeInterpolator = new DecelerateInterpolator(factor);
}
origin: stackoverflow.com

 RotateAnimation anim = new RotateAnimation(0f, 350f, 15f, 15f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);

// Start animating the image
final ImageView splash = (ImageView) findViewById(R.id.splash);
splash.startAnimation(anim);

// Later.. stop the animation
splash.setAnimation(null);
origin: stackoverflow.com

public void onAnimationEnd(Animation animation) {
     animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
     animation.setDuration(1);
     mPlayer0Panel.startAnimation(animation);
 }
origin: stackoverflow.com

 final int newLeftMargin = <some value>;
Animation a = new Animation() {

  @Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    LayoutParams params = yourView.getLayoutParams();
    params.leftMargin = (int)(newLeftMargin * interpolatedTime);
    yourView.setLayoutParams(params);
  }
};
a.setDuration(500); // in ms
yourView.startAnimation(a);
origin: stackoverflow.com

animation1 = new AlphaAnimation(0.0f, 1.0f);
 animation1.setDuration(1000);
 animation1.setStartOffset(5000);
 animation2 = new AlphaAnimation(1.0f, 0.0f);
 animation2.setDuration(1000);
 animation2.setStartOffset(5000);
 textView.startAnimation(animation1);
origin: nickbutcher/plaid

public static Interpolator getFastOutLinearInInterpolator(Context context) {
  if (fastOutLinearIn == null) {
    fastOutLinearIn = AnimationUtils.loadInterpolator(context,
        android.R.interpolator.fast_out_linear_in);
  }
  return fastOutLinearIn;
}
origin: commonsguy/cw-omnibus

/**
 * Gets the current position of the animation in time, which is equal to the current
 * time minus the time that the animation started. An animation that is not yet started will
 * return a value of zero.
 *
 * @return The current position in time of the animation.
 */
public long getCurrentPlayTime() {
  if (!mInitialized || mPlayingState == STOPPED) {
    return 0;
  }
  return AnimationUtils.currentAnimationTimeMillis() - mStartTime;
}
origin: scwang90/SmartRefreshLayout

public void start(float fromAlpha, float toAlpha) {
  mFromAlpha = fromAlpha;
  mToAlpha = toAlpha;
  super.start();
}
origin: aporter/coursera-android

  private Animation outToLeftAnimation() {
    Animation outToLeft = new TranslateAnimation(
        Animation.RELATIVE_TO_PARENT, 0.0f,
        Animation.RELATIVE_TO_PARENT, -1.0f,
        Animation.RELATIVE_TO_PARENT, 0.0f,
        Animation.RELATIVE_TO_PARENT, 0.0f);
    outToLeft.setDuration(500);
    outToLeft.setInterpolator(new LinearInterpolator());
    return outToLeft;
  }
}
origin: nickbutcher/plaid

public static Interpolator getLinearInterpolator() {
  if (linear == null) {
    linear = new LinearInterpolator();
  }
  return linear;
}
origin: nickbutcher/plaid

public static Interpolator getLinearOutSlowInInterpolator(Context context) {
  if (linearOutSlowIn == null) {
    linearOutSlowIn = AnimationUtils.loadInterpolator(context,
        android.R.interpolator.linear_out_slow_in);
  }
  return linearOutSlowIn;
}
origin: nickbutcher/plaid

public static Interpolator getFastOutSlowInInterpolator(Context context) {
  if (fastOutSlowIn == null) {
    fastOutSlowIn = AnimationUtils.loadInterpolator(context,
        android.R.interpolator.fast_out_slow_in);
  }
  return fastOutSlowIn;
}
android.view.animation

Most used classes

  • Animation
  • AnimationUtils
  • DecelerateInterpolator
  • LinearInterpolator
  • AccelerateDecelerateInterpolator
  • AlphaAnimation,
  • TranslateAnimation,
  • Interpolator,
  • RotateAnimation,
  • OvershootInterpolator,
  • ScaleAnimation,
  • AnimationSet,
  • BounceInterpolator,
  • Transformation,
  • CycleInterpolator,
  • Animation$AnimationListener,
  • AnticipateInterpolator,
  • AnticipateOvershootInterpolator,
  • LayoutAnimationController
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now