use of android.view.ViewPropertyAnimator in project wire-android by wireapp.
the class SingleImageFragment method backToConversation.
private void backToConversation(boolean afterFling) {
if (isClosing) {
return;
}
isClosing = true;
loadClickedImageSizeAndPosition();
initAnimatingImageView(afterFling);
getControllerFactory().getSingleImageController().hideSingleImage();
fadeControls(false);
PointF currentFocusPoint = messageTouchImageView.getScrollPosition();
if (currentFocusPoint == null) {
getControllerFactory().getSingleImageController().clearReferences();
getFragmentManager().popBackStack();
return;
}
TouchImageView.FocusAndScale startFocusAndScale = new TouchImageView.FocusAndScale(currentFocusPoint.x, currentFocusPoint.y, messageTouchImageView.getCurrentZoom());
TouchImageView.FocusAndScale finishFocusAndScale = new TouchImageView.FocusAndScale(0.5f, 0.5f, 1f);
if ((MathUtils.floatEqual(currentFocusPoint.x, 0.5f) || MathUtils.floatEqual(currentFocusPoint.y, 0.5f)) && MathUtils.floatEqual(messageTouchImageView.getCurrentZoom(), 1f)) {
zoomOutAndRotateBackOnCloseDuration = 1;
}
ObjectAnimator.ofObject(messageTouchImageView, "focusAndScale", new TouchImageView.FocusAndScaleEvaluator(), startFocusAndScale, finishFocusAndScale).setDuration(zoomOutAndRotateBackOnCloseDuration).start();
final boolean imageOffScreenInList = getControllerFactory().getSingleImageController().isContainerOutOfScreen();
ViewPropertyAnimator exitAnimation = animatingImageView.animate();
if (imageOffScreenInList) {
exitAnimation.alpha(0);
} else {
exitAnimation.x(clickedImageLocation.x).y(clickedImageLocation.y).rotation(0f).scaleX(1f).scaleY(1f);
}
exitAnimation.setDuration(openAnimationDuration).setStartDelay(zoomOutAndRotateBackOnCloseDuration).setInterpolator(new Expo.EaseOut()).withStartAction(new Runnable() {
@Override
public void run() {
animatingImageView.setVisibility(View.VISIBLE);
messageTouchImageView.setVisibility(View.GONE);
if (imageOffScreenInList) {
getControllerFactory().getSingleImageController().getImageContainer().setVisibility(View.VISIBLE);
} else {
getControllerFactory().getSingleImageController().getImageContainer().setVisibility(View.INVISIBLE);
}
}
}).withEndAction(new Runnable() {
@Override
public void run() {
getControllerFactory().getSingleImageController().getImageContainer().setVisibility(View.VISIBLE);
getControllerFactory().getSingleImageController().clearReferences();
getFragmentManager().popBackStack();
}
});
exitAnimation.start();
background.animate().alpha(0f).setStartDelay(zoomOutAndRotateBackOnCloseDuration + closeAnimationBackgroundDelay).setDuration(openAnimationBackgroundDuration).setInterpolator(new Quart.EaseOut()).start();
}
use of android.view.ViewPropertyAnimator in project android_frameworks_base by AOSPA.
the class RecentsView method onBusEvent.
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
ViewPropertyAnimator animator = animate();
if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
animator.translationY(getHeight());
animator.withEndAction(new Runnable() {
@Override
public void run() {
WindowManagerProxy.getInstance().maximizeDockedStack();
}
});
mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
} else {
animator.translationY(0f);
animator.setListener(null);
mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
}
animator.start();
}
use of android.view.ViewPropertyAnimator in project Genius-Android by qiujuer.
the class BalloonMarker method onOpeningComplete.
@Override
public void onOpeningComplete() {
mNumber.setVisibility(View.VISIBLE);
ViewPropertyAnimator animator = mNumber.animate();
animator.alpha(1f);
animator.setDuration(100);
animator.start();
if (getParent() instanceof BalloonMarkerDrawable.MarkerAnimationListener) {
((BalloonMarkerDrawable.MarkerAnimationListener) getParent()).onOpeningComplete();
}
}
use of android.view.ViewPropertyAnimator in project android_frameworks_base by ResurrectionRemix.
the class RecentsView method onBusEvent.
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
ViewPropertyAnimator animator = animate();
if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
animator.translationY(getHeight());
animator.withEndAction(new Runnable() {
@Override
public void run() {
WindowManagerProxy.getInstance().maximizeDockedStack();
}
});
mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
} else {
animator.translationY(0f);
animator.setListener(null);
mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
}
animator.start();
}
use of android.view.ViewPropertyAnimator in project android_frameworks_base by crdroidandroid.
the class RecentsView method onBusEvent.
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
ViewPropertyAnimator animator = animate();
if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
animator.translationY(getHeight());
animator.withEndAction(new Runnable() {
@Override
public void run() {
WindowManagerProxy.getInstance().maximizeDockedStack();
}
});
mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
} else {
animator.translationY(0f);
animator.setListener(null);
mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
}
animator.start();
}
Aggregations