use of android.view.animation.OvershootInterpolator in project mosby by sockeqwe.
the class MailsFragment method showContent.
@Override
public void showContent() {
super.showContent();
if (createMailButton.getVisibility() != View.VISIBLE) {
createMailButton.setVisibility(View.VISIBLE);
if (!isRestoringViewState()) {
PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("scaleX", 0, 1);
PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("scaleY", 0, 1);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(createMailButton, holderX, holderY);
animator.setInterpolator(new OvershootInterpolator());
animator.start();
}
}
}
use of android.view.animation.OvershootInterpolator in project FlowingDrawer by mxn21.
the class ElasticDrawer method flowDown.
private void flowDown(final int finalX) {
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mMenuView.setUpDownFraction(animation.getAnimatedFraction());
}
});
valueAnimator.addListener(new FlowingAnimationListener() {
@Override
public void onAnimationEnd(Animator animation) {
if (mDrawerState == STATE_OPENING) {
mMenuVisible = finalX != 0;
setOffsetPixels(finalX, 0, FlowingMenuLayout.TYPE_NONE);
setDrawerState(finalX == 0 ? STATE_CLOSED : STATE_OPEN);
stopLayerTranslation();
}
}
});
valueAnimator.setDuration(300);
valueAnimator.setInterpolator(new OvershootInterpolator(4f));
valueAnimator.start();
}
use of android.view.animation.OvershootInterpolator in project PhotoNoter by yydcdut.
the class DetailActivity method upAnimation.
@Override
public void upAnimation() {
View adapterPositionView = mDetailPagerAdapter.getItemView(mViewPager.getCurrentItem());
View blurView;
if (adapterPositionView != null) {
blurView = adapterPositionView.findViewById(R.id.img_blur);
} else {
blurView = mOverlayView;
}
final View finalBlurView = blurView;
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ObjectAnimator.ofFloat(mCardView, "translationY", mTranslateHeight, 0), ObjectAnimator.ofFloat(mViewPager, "scaleX", 1f, 1.1f), ObjectAnimator.ofFloat(mViewPager, "scaleY", 1f, 1.1f), ObjectAnimator.ofFloat(finalBlurView, "alpha", 0f, 1f));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
finalBlurView.setVisibility(View.VISIBLE);
mOverlayView.setVisibility(View.VISIBLE);
mIsIgnoreClick = true;
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mIsIgnoreClick = false;
}
});
animatorSet.setDuration(400);
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.start();
mAnimationHandler.postDelayed(mUpDelayRunnable, 500);
}
use of android.view.animation.OvershootInterpolator in project PhotoNoter by yydcdut.
the class FloatingActionsMenu method createAddButton.
private void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
void updateBackground() {
mPlusColor = mAddButtonPlusColor;
mColorNormal = mAddButtonColorNormal;
mColorPressed = mAddButtonColorPressed;
mStrokeVisible = mAddButtonStrokeVisible;
super.updateBackground();
}
@Override
Drawable getIconDrawable() {
final RotatingDrawable rotatingDrawable = new RotatingDrawable(super.getIconDrawable());
mRotatingDrawable = rotatingDrawable;
final OvershootInterpolator interpolator = new OvershootInterpolator();
final ObjectAnimator collapseAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);
final ObjectAnimator expandAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);
collapseAnimator.setInterpolator(interpolator);
expandAnimator.setInterpolator(interpolator);
mExpandAnimation.play(expandAnimator);
mCollapseAnimation.play(collapseAnimator);
return rotatingDrawable;
}
};
mAddButton.setId(R.id.fab_expand_menu_button);
mAddButton.setSize(mAddButtonSize);
mAddButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggle();
}
});
addView(mAddButton, super.generateDefaultLayoutParams());
}
use of android.view.animation.OvershootInterpolator in project AndroidSweetSheet by zzz40500.
the class SweetView method duang.
public void duang() {
mStatus = Status.STATUS_DOWN;
ValueAnimator valueAnimator = ValueAnimator.ofInt(mMaxArcHeight, 0);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mArcHeight = (int) animation.getAnimatedValue();
invalidate();
}
});
valueAnimator.addListener(new SimpleAnimationListener() {
@Override
public void onAnimationEnd(Animator animation) {
if (mAnimationListener != null) {
mAnimationListener.onEnd();
}
}
});
valueAnimator.setDuration(500);
valueAnimator.setInterpolator(new OvershootInterpolator(4f));
valueAnimator.start();
}
Aggregations