Search in sources :

Example 1 with SimpleAnimationListener

use of org.thoughtcrime.securesms.mediasend.SimpleAnimationListener in project Signal-Android by signalapp.

the class WebRtcCallView method animatePipToLargeRectangle.

private void animatePipToLargeRectangle(boolean isLandscape) {
    final Point dimens;
    if (isLandscape) {
        dimens = new Point(ViewUtil.dpToPx(160), ViewUtil.dpToPx(90));
    } else {
        dimens = new Point(ViewUtil.dpToPx(90), ViewUtil.dpToPx(160));
    }
    ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, dimens.x, dimens.y);
    animation.setDuration(PIP_RESIZE_DURATION);
    animation.setAnimationListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animation animation) {
            pictureInPictureGestureHelper.enableCorners();
            pictureInPictureGestureHelper.adjustPip();
        }
    });
    smallLocalRenderFrame.startAnimation(animation);
}
Also used : ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) SimpleAnimationListener(org.thoughtcrime.securesms.mediasend.SimpleAnimationListener) Animation(android.view.animation.Animation) ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) Point(android.graphics.Point)

Example 2 with SimpleAnimationListener

use of org.thoughtcrime.securesms.mediasend.SimpleAnimationListener in project Signal-Android by WhisperSystems.

the class WebRtcCallView method animatePipToLargeRectangle.

private void animatePipToLargeRectangle(boolean isLandscape) {
    final Point dimens;
    if (isLandscape) {
        dimens = new Point(ViewUtil.dpToPx(160), ViewUtil.dpToPx(90));
    } else {
        dimens = new Point(ViewUtil.dpToPx(90), ViewUtil.dpToPx(160));
    }
    ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, dimens.x, dimens.y);
    animation.setDuration(PIP_RESIZE_DURATION);
    animation.setAnimationListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animation animation) {
            pictureInPictureGestureHelper.enableCorners();
            pictureInPictureGestureHelper.adjustPip();
        }
    });
    smallLocalRenderFrame.startAnimation(animation);
}
Also used : ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) SimpleAnimationListener(org.thoughtcrime.securesms.mediasend.SimpleAnimationListener) Animation(android.view.animation.Animation) ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) Point(android.graphics.Point)

Example 3 with SimpleAnimationListener

use of org.thoughtcrime.securesms.mediasend.SimpleAnimationListener 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);
    });
}
Also used : ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) SimpleAnimationListener(org.thoughtcrime.securesms.mediasend.SimpleAnimationListener) Animation(android.view.animation.Animation) ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation)

Example 4 with SimpleAnimationListener

use of org.thoughtcrime.securesms.mediasend.SimpleAnimationListener 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);
    });
}
Also used : ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation) SimpleAnimationListener(org.thoughtcrime.securesms.mediasend.SimpleAnimationListener) Animation(android.view.animation.Animation) ResizeAnimation(org.thoughtcrime.securesms.animation.ResizeAnimation)

Aggregations

Animation (android.view.animation.Animation)4 ResizeAnimation (org.thoughtcrime.securesms.animation.ResizeAnimation)4 SimpleAnimationListener (org.thoughtcrime.securesms.mediasend.SimpleAnimationListener)4 Point (android.graphics.Point)2