use of com.aviary.android.feather.library.graphics.animation.CustomAlphaAnimation in project mobile-android by photo.
the class IapNotificationLayout method hide.
public void hide(long delayMillis) {
if (getHandler() == null)
return;
if (getParent() == null)
return;
if (getVisibility() == View.GONE)
return;
AnimationListener listener = new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
setVisibility(View.GONE);
}
};
float currentAlpha = 1.0f;
final Animation animation = getAnimation();
if (animation != null) {
if (animation instanceof CustomAlphaAnimation) {
currentAlpha = ((CustomAlphaAnimation) animation).getAlpha();
}
getAnimation().setAnimationListener(null);
clearAnimation();
}
Animation newAnimation = new AlphaAnimation(currentAlpha, 0);
newAnimation.setDuration(mIapHideDuration);
newAnimation.setStartOffset(delayMillis);
newAnimation.setAnimationListener(listener);
startAnimation(newAnimation);
}
use of com.aviary.android.feather.library.graphics.animation.CustomAlphaAnimation in project mobile-android by photo.
the class IapNotificationLayout method show.
public void show(long delayMillis) {
AnimationListener listener = new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
hide();
}
};
Animation animation = new CustomAlphaAnimation(0.0f, 1.0f);
animation.setStartOffset(delayMillis);
animation.setInterpolator(new DecelerateInterpolator(1.0f));
animation.setDuration(mIapShowDuration);
animation.setAnimationListener(listener);
startAnimation(animation);
}
Aggregations