use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class ConversationItemFooter method showPlaybackSpeedToggle.
private void showPlaybackSpeedToggle() {
if (hasShrunkDate) {
return;
}
hasShrunkDate = true;
playbackSpeedToggleTextView.animate().alpha(1f).scaleX(1f).scaleY(1f).setDuration(150L).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
playbackSpeedToggleTextView.setClickable(true);
}
});
if (isOutgoing) {
dateView.setMaxWidth(ViewUtil.dpToPx(28));
} else {
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(this);
constraintSet.constrainMaxWidth(R.id.date_and_expiry_wrapper, ViewUtil.dpToPx(40));
constraintSet.applyTo(this);
}
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class ConversationItemFooter method hidePlaybackSpeedToggle.
private void hidePlaybackSpeedToggle() {
if (!hasShrunkDate) {
return;
}
hasShrunkDate = false;
playbackSpeedToggleTextView.animate().alpha(0f).scaleX(0.5f).scaleY(0.5f).setDuration(150L).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
playbackSpeedToggleTextView.setClickable(false);
playbackSpeedToggleTextView.clearRequestedSpeed();
}
});
if (isOutgoing) {
dateView.setMaxWidth(Integer.MAX_VALUE);
} else {
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(this);
constraintSet.constrainMaxWidth(R.id.date_and_expiry_wrapper, -1);
constraintSet.applyTo(this);
}
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class PictureInPictureGestureHelper method fling.
private void fling() {
Point projection = new Point((int) projectionX, (int) projectionY);
Point nearestCornerPosition = findNearestCornerPosition(projection);
isAnimating = true;
isDragging = false;
child.animate().translationX(getTranslationXForPoint(nearestCornerPosition)).translationY(getTranslationYForPoint(nearestCornerPosition)).setDuration(250).setInterpolator(interpolator).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
isAnimating = false;
Iterator<Runnable> afterFlingRunnables = runAfterFling.iterator();
while (afterFlingRunnables.hasNext()) {
Runnable runnable = afterFlingRunnables.next();
runnable.run();
afterFlingRunnables.remove();
}
}
}).start();
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class SearchToolbar method hide.
@MainThread
private void hide() {
if (getVisibility() == View.VISIBLE) {
if (listener != null)
listener.onSearchClosed();
if (Build.VERSION.SDK_INT >= 21) {
Animator animator = ViewAnimationUtils.createCircularReveal(this, (int) x, (int) y, getWidth(), 0);
animator.setDuration(400);
animator.addListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
setVisibility(View.INVISIBLE);
}
});
animator.start();
} else {
setVisibility(View.INVISIBLE);
}
}
}
use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.
the class CameraXFragment method fadeOutControls.
@Override
public void fadeOutControls(@NonNull Runnable onEndAction) {
controlsContainer.setEnabled(false);
controlsContainer.animate().setDuration(250).alpha(0f).setInterpolator(MediaAnimations.getInterpolator()).setListener(new AnimationCompleteListener() {
@Override
public void onAnimationEnd(Animator animation) {
controlsContainer.setEnabled(true);
onEndAction.run();
}
});
}
Aggregations