Created
October 22, 2020 11:53
-
-
Save Dmuasya/2db2d762347669bea9d557eceebeb71f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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