use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class Camera1Fragment method fadeOutControls.
@Override
public void fadeOutControls(@NonNull Runnable onEndAction) {
controlsContainer.setEnabled(false);
controlsContainer.animate().setInterpolator(MediaAnimations.getInterpolator()).setDuration(250).alpha(0f).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
controlsContainer.setEnabled(true);
onEndAction.run();
}
});
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class Camera1Fragment method fadeInControls.
@Override
public void fadeInControls() {
controlsContainer.setEnabled(false);
controlsContainer.animate().setInterpolator(MediaAnimations.getInterpolator()).setDuration(250).alpha(1f).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
controlsContainer.setEnabled(true);
}
});
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class CameraXFragment method fadeInControls.
@Override
public void fadeInControls() {
controlsContainer.setEnabled(false);
controlsContainer.animate().setDuration(250).alpha(1f).setInterpolator(MediaAnimations.getInterpolator()).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
controlsContainer.setEnabled(true);
}
});
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class ConfirmKbsPinFragment method updateSaveAnimation.
private void updateSaveAnimation(@NonNull ConfirmKbsPinViewModel.SaveAnimation animation) {
updateAnimationAndInputVisibility(animation);
LottieAnimationView lottieProgress = getLottieProgress();
switch(animation) {
case NONE:
lottieProgress.cancelAnimation();
break;
case LOADING:
lottieProgress.setAnimation(R.raw.lottie_kbs_loading);
lottieProgress.setRepeatMode(LottieDrawable.RESTART);
lottieProgress.setRepeatCount(LottieDrawable.INFINITE);
lottieProgress.playAnimation();
break;
case SUCCESS:
startEndAnimationOnNextProgressRepetition(R.raw.lottie_kbs_success, new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
requireActivity().setResult(Activity.RESULT_OK);
closeNavGraphBranch();
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
StorageSyncHelper.scheduleSyncForDataChange();
}
});
break;
case FAILURE:
startEndAnimationOnNextProgressRepetition(R.raw.lottie_kbs_fail, new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
displayFailedDialog();
}
});
break;
}
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class ConfirmKbsPinFragment method startEndAnimationOnNextProgressRepetition.
private void startEndAnimationOnNextProgressRepetition(@RawRes int lottieAnimationId, @NonNull AnimationCompleteListener listener) {
LottieAnimationView lottieProgress = getLottieProgress();
LottieAnimationView lottieEnd = getLottieEnd();
lottieEnd.setAnimation(lottieAnimationId);
lottieEnd.removeAllAnimatorListeners();
lottieEnd.setRepeatCount(0);
lottieEnd.addAnimatorListener(listener);
if (lottieProgress.isAnimating()) {
lottieProgress.addAnimatorListener(new AnimationRepeatListener(animator -> hideProgressAndStartEndAnimation(lottieProgress, lottieEnd)));
} else {
hideProgressAndStartEndAnimation(lottieProgress, lottieEnd);
}
}
Aggregations