use of org.thoughtcrime.securesms.animation.ResizeAnimation in project Signal-Android by WhisperSystems.
the class WebRtcCallView method animatePipToSmallRectangle.
private void animatePipToSmallRectangle() {
pictureInPictureGestureHelper.lockToBottomEnd();
pictureInPictureGestureHelper.performAfterFling(() -> {
ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, ViewUtil.dpToPx(54), ViewUtil.dpToPx(72));
animation.setDuration(PIP_RESIZE_DURATION);
animation.setAnimationListener(new SimpleAnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
pictureInPictureGestureHelper.adjustPip();
}
});
smallLocalRenderFrame.startAnimation(animation);
});
}
use of org.thoughtcrime.securesms.animation.ResizeAnimation in project Signal-Android by WhisperSystems.
the class ImageEditorFragment method restoreViewPortScaling.
private void restoreViewPortScaling(int orientation) {
if (resizeAnimation != null) {
resizeAnimation.cancel();
}
int maxHeight = getHeightForOrientation(orientation);
float aspectRatio = getAspectRatioForOrientation(orientation);
int targetWidth = getWidthForOrientation(orientation);
int targetHeight = (int) ((1 / aspectRatio) * targetWidth);
if (targetHeight > maxHeight) {
targetHeight = maxHeight;
targetWidth = Math.round(targetHeight * aspectRatio);
}
resizeAnimation = new ResizeAnimation(imageEditorView, targetWidth, targetHeight);
resizeAnimation.setDuration(250);
resizeAnimation.setInterpolator(MediaAnimations.getInterpolator());
imageEditorView.startAnimation(resizeAnimation);
}
use of org.thoughtcrime.securesms.animation.ResizeAnimation in project Signal-Android by signalapp.
the class WebRtcCallView method animatePipToSmallRectangle.
private void animatePipToSmallRectangle() {
pictureInPictureGestureHelper.lockToBottomEnd();
pictureInPictureGestureHelper.performAfterFling(() -> {
ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, ViewUtil.dpToPx(54), ViewUtil.dpToPx(72));
animation.setDuration(PIP_RESIZE_DURATION);
animation.setAnimationListener(new SimpleAnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
pictureInPictureGestureHelper.adjustPip();
}
});
smallLocalRenderFrame.startAnimation(animation);
});
}
Aggregations