Skip to content

Instantly share code, notes, and snippets.

@Dmuasya
Created October 22, 2020 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dmuasya/2db2d762347669bea9d557eceebeb71f to your computer and use it in GitHub Desktop.
Save Dmuasya/2db2d762347669bea9d557eceebeb71f to your computer and use it in GitHub Desktop.
package com.dennis.notification.effects.lib.effects;
import android.view.View;
import com.nineoldandroids.animation.ObjectAnimator;
public class SlideIn extends BaseEffect {
@Override
protected void setInAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "translationX", -view.getWidth(), -10,-20,-5,-10,0).setDuration(mDuration)
);
}
@Override
protected void setOutAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "translationX", 0,-10,view.getWidth()).setDuration(mDuration)
);
}
@Override
protected long getAnimDuration(long duration) {
return duration;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment