use of android.view.ViewPropertyAnimator in project android_frameworks_base by ParanoidAndroid.
the class RecentsPanelView method animateInIconOfFirstTask.
private void animateInIconOfFirstTask() {
if (mItemToAnimateInWhenWindowAnimationIsFinished != null && !mRecentTasksLoader.isFirstScreenful()) {
int timeSinceWindowAnimation = (int) (System.currentTimeMillis() - mWindowAnimationStartTime);
final int minStartDelay = 150;
final int startDelay = Math.max(0, Math.min(minStartDelay - timeSinceWindowAnimation, minStartDelay));
final int duration = 250;
final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished;
final TimeInterpolator cubic = new DecelerateInterpolator(1.5f);
FirstFrameAnimatorHelper.initializeDrawListener(holder.iconView);
for (View v : new View[] { holder.iconView, holder.labelView, holder.calloutLine }) {
if (v != null) {
ViewPropertyAnimator vpa = v.animate().translationX(0).translationY(0).alpha(1f).setStartDelay(startDelay).setDuration(duration).setInterpolator(cubic);
FirstFrameAnimatorHelper h = new FirstFrameAnimatorHelper(vpa, v);
}
}
mItemToAnimateInWhenWindowAnimationIsFinished = null;
mAnimateIconOfFirstTask = false;
}
}
use of android.view.ViewPropertyAnimator in project platform_frameworks_base by android.
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 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 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();
}
Aggregations