Хорошо, я нашел решение.
Создайте xml в папке anim с именем popup_slider.xml
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="true">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="100" />
<translate android:fromYDelta="100%p" android:toYDelta="0%p" android:startOffset="1000" android:duration="5000" android:zAdjustment="top"/>
<alpha android:fromAlpha="0.99" android:toAlpha="1.0" android:startOffset="6000" android:duration="5000" />
<translate android:fromYDelta="0%p" android:toYDelta="100%p" android:startOffset="11000" android:duration="5000" android:zAdjustment="bottom"/>
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:startOffset="16000" android:duration="1000" />
</set>
В Java реализован AnimationListener
public static void popUpAndDownAnimation(View v) {
Animation animation = AnimationUtils.loadAnimation(localContext, R.anim.popup_slider);
animation.setAnimationListener(new Animation.AnimationListener(){
public void onAnimationEnd(Animation arg0) {
popUpAdvertisementView.setVisibility(View.GONE);
}
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
public void onAnimationStart(Animation animation) {
popUpAdvertisementView.setVisibility(View.VISIBLE);
}
});
v.startAnimation(animation);
}