use of android.view.animation.OvershootInterpolator in project Signal-Android by WhisperSystems.
the class VerificationCodeView method append.
@MainThread
public void append(int value) {
if (index >= codes.size())
return;
setInactive(containers);
setActive(containers.get(index));
TextView codeView = codes.get(index++);
Animation translateIn = new TranslateAnimation(0, 0, codeView.getHeight(), 0);
translateIn.setInterpolator(new OvershootInterpolator());
translateIn.setDuration(500);
Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setDuration(200);
AnimationSet animationSet = new AnimationSet(false);
animationSet.addAnimation(fadeIn);
animationSet.addAnimation(translateIn);
animationSet.reset();
animationSet.setStartTime(0);
codeView.setText(String.valueOf(value));
codeView.clearAnimation();
codeView.startAnimation(animationSet);
if (index == codes.size() && listener != null) {
listener.onCodeComplete(Stream.of(codes).map(TextView::getText).collect(Collectors.joining()));
}
}
use of android.view.animation.OvershootInterpolator in project InstaMaterial by frogermcs.
the class FeedContextMenuManager method performShowAnimation.
private void performShowAnimation() {
contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
contextMenuView.setPivotY(contextMenuView.getHeight());
contextMenuView.setScaleX(0.1f);
contextMenuView.setScaleY(0.1f);
contextMenuView.animate().scaleX(1f).scaleY(1f).setDuration(150).setInterpolator(new OvershootInterpolator()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isContextMenuShowing = false;
}
});
}
use of android.view.animation.OvershootInterpolator in project InstaMaterial by frogermcs.
the class PublishActivity method loadThumbnailPhoto.
private void loadThumbnailPhoto() {
ivPhoto.setScaleX(0);
ivPhoto.setScaleY(0);
Picasso.with(this).load(photoUri).centerCrop().resize(photoSize, photoSize).into(ivPhoto, new Callback() {
@Override
public void onSuccess() {
ivPhoto.animate().scaleX(1.f).scaleY(1.f).setInterpolator(new OvershootInterpolator()).setDuration(400).setStartDelay(200).start();
}
@Override
public void onError() {
}
});
}
use of android.view.animation.OvershootInterpolator in project CircularFloatingActionMenu by oguzbilgener.
the class DefaultAnimationHandler method animateMenuOpening.
@Override
public void animateMenuOpening(Point center) {
super.animateMenuOpening(center);
setAnimating(true);
Animator lastAnimation = null;
for (int i = 0; i < menu.getSubActionItems().size(); i++) {
menu.getSubActionItems().get(i).view.setScaleX(0);
menu.getSubActionItems().get(i).view.setScaleY(0);
menu.getSubActionItems().get(i).view.setAlpha(0);
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat(View.TRANSLATION_X, menu.getSubActionItems().get(i).x - center.x + menu.getSubActionItems().get(i).width / 2);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, menu.getSubActionItems().get(i).y - center.y + menu.getSubActionItems().get(i).height / 2);
PropertyValuesHolder pvhR = PropertyValuesHolder.ofFloat(View.ROTATION, 720);
PropertyValuesHolder pvhsX = PropertyValuesHolder.ofFloat(View.SCALE_X, 1);
PropertyValuesHolder pvhsY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1);
PropertyValuesHolder pvhA = PropertyValuesHolder.ofFloat(View.ALPHA, 1);
final ObjectAnimator animation = ObjectAnimator.ofPropertyValuesHolder(menu.getSubActionItems().get(i).view, pvhX, pvhY, pvhR, pvhsX, pvhsY, pvhA);
animation.setDuration(DURATION);
animation.setInterpolator(new OvershootInterpolator(0.9f));
animation.addListener(new SubActionItemAnimationListener(menu.getSubActionItems().get(i), ActionType.OPENING));
if (i == 0) {
lastAnimation = animation;
}
// Put a slight lag between each of the menu items to make it asymmetric
animation.setStartDelay((menu.getSubActionItems().size() - i) * LAG_BETWEEN_ITEMS);
animation.start();
}
if (lastAnimation != null) {
lastAnimation.addListener(new LastAnimationListener());
}
}
use of android.view.animation.OvershootInterpolator in project ENViews by codeestX.
the class ENDownloadView method reset.
public void reset() {
if (mCurrentState != STATE_RESET) {
return;
}
ValueAnimator resetAnim = ValueAnimator.ofFloat(1.f, 100.f);
resetAnim.setDuration(500);
resetAnim.setInterpolator(new OvershootInterpolator());
resetAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mFraction = valueAnimator.getAnimatedFraction();
invalidate();
}
});
resetAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mFraction = 0;
mCurrentState = STATE_PRE;
if (onDownloadStateListener != null) {
onDownloadStateListener.onResetFinish();
}
}
});
resetAnim.start();
}
Aggregations