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);
}
}
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 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 PeaceOfMindActivity method stopPeaceOfMindVideo.
private void stopPeaceOfMindVideo() {
mVideo.removeCallbacks(null);
if (mVideo.getVisibility() != View.VISIBLE) {
mVideo.setVisibility(View.VISIBLE);
}
Animation fadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out_fast);
mVideo.startAnimation(fadeOut);
updateBackground(false);
fadeOut.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
mVideo.setVisibility(View.INVISIBLE);
mVideo.stopPlayback();
}
});
}
use of android.view.animation.Animation.AnimationListener in project Fairphone by Kwamecorp.
the class PeaceOfMindActivity method peaceOfMindEnded.
@Override
public synchronized void peaceOfMindEnded() {
try {
mSemaphore.tryAcquire(1, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
Animation fadeIn = AnimationUtils.loadAnimation(this, R.anim.fade_in_fast);
mSeekbarBackgroundOff.startAnimation(fadeIn);
Animation fadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out_fast);
mSeekbarBackgroundOn.startAnimation(fadeOut);
fadeIn.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
mSeekbarBackgroundOff.setVisibility(View.VISIBLE);
mSeekbarBackgroundOn.setVisibility(View.GONE);
updateScreenTexts();
stopPeaceOfMindVideo();
mSemaphore.release();
}
});
updateScreenTexts();
mVerticalSeekBar.setThumb(getResources().getDrawable(R.drawable.seekbar_thumb_off));
mVerticalSeekBar.setThumbOffset(0);
mVerticalSeekBar.setInvertedProgress(0);
updateTextForNewTime(0, 0);
updateTimeTextLabel(0);
mTotalTimeText.setVisibility(View.INVISIBLE);
}
Aggregations