use of android.view.animation.Animation.AnimationListener in project ListViewCellDeleteAnimation by paraches.
the class MainActivity method deleteCell.
private void deleteCell(final View v, final int index) {
AnimationListener al = new AnimationListener() {
@Override
public void onAnimationEnd(Animation arg0) {
mAnimList.remove(index);
ViewHolder vh = (ViewHolder) v.getTag();
vh.needInflate = true;
mMyAnimListAdapter.notifyDataSetChanged();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationStart(Animation animation) {
}
};
collapse(v, al);
}
use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.
the class EdgeSwipeAppMenuHelper method setBackgroundExitAnimation.
private void setBackgroundExitAnimation() {
Animation backAnimation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_background_fade_out);
backAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
backVisible = false;
menuBackground.setVisibility(View.INVISIBLE);
menuRoot.setVisibility(View.INVISIBLE);
}
});
menuBackground.startAnimation(backAnimation);
}
use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.
the class EdgeSwipeAppMenuHelper method setMenuSideExitAnimation.
private void setMenuSideExitAnimation() {
// draw back the menu
// load the correct side for the animation
Animation animation = null;
if (getCurrentSide() == Side.LEFT) {
animation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_disappear_to_left_animation);
} else {
animation = AnimationUtils.loadAnimation(menuRoot.getContext(), R.anim.menu_disappear_to_right_animation);
}
getMenuContainerView().setVisibility(View.VISIBLE);
contentVisible = true;
backVisible = true;
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
menuRoot.setVisibility(View.INVISIBLE);
contentVisible = false;
if (!backVisible) {
getMenuContainerView().setVisibility(View.GONE);
}
}
});
menuContent.startAnimation(animation);
}
use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.
the class OOBEActivity method stopIntroVideo.
private void stopIntroVideo() {
mVideo.stopPlayback();
final RelativeLayout rl = (RelativeLayout) findViewById(R.id.oobeVideoViewGroup);
Animation fadeOutAnimation = AnimationUtils.loadAnimation(OOBEActivity.this, R.anim.fade_out_slow);
rl.startAnimation(fadeOutAnimation);
fadeOutAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
rl.setVisibility(View.GONE);
mVideo.setVisibility(View.GONE);
mSkipVideoButton.setVisibility(View.GONE);
}
});
startTutorialInitialAnimation();
}
use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.
the class EditFavoritesActivity method startViewFadeOutFadeInAnimation.
/**
* Performs the animation when replacing one favorite
*
* @param viewToFadeIn
* view that will appear. When null it means that we are swapping
* two favorites
* @param viewToFadeOut
* view that will disappear.
* @param applicationInfo
* app info that is used to swap two favorites
*/
private void startViewFadeOutFadeInAnimation(final View viewToFadeIn, final View viewToFadeOut, final ApplicationInfo applicationInfo) {
Animation fadeOutAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_out_fast);
fadeOutAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
viewToFadeOut.setVisibility(View.INVISIBLE);
if (applicationInfo == null && viewToFadeIn != null) {
if (viewToFadeIn.getVisibility() != View.VISIBLE) {
viewToFadeIn.setVisibility(View.VISIBLE);
Animation fadeInAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_in_fast);
viewToFadeIn.startAnimation(fadeInAnimation);
}
} else if (applicationInfo != null) {
// get the new icon
updateFavoriteIcon(applicationInfo, (TextView) viewToFadeOut);
viewToFadeOut.setVisibility(View.VISIBLE);
Animation fadeInAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_in_fast);
viewToFadeOut.startAnimation(fadeInAnimation);
}
}
});
if (viewToFadeOut.getVisibility() == View.VISIBLE) {
viewToFadeOut.startAnimation(fadeOutAnimation);
}
}
Aggregations