use of com.nineoldandroids.animation.Animator in project MaterialCalendar by Haoxiqiang.
the class MemoFragment method release.
void release() {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(mBluePair, "bottom", mBluePair.getBottom(), startBluePairBottom);
objectAnimator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd(Animator animator) {
disappearBluePair();
}
});
objectAnimator.setInterpolator(ACCELERATE_DECELERATE);
objectAnimator.start();
}
use of com.nineoldandroids.animation.Animator in project NineOldAndroids by JakeWharton.
the class ViewPropertyAnimatorHC method animatePropertyBy.
/**
* Utility function, called by animateProperty() and animatePropertyBy(), which handles the
* details of adding a pending animation and posting the request to start the animation.
*
* @param constantName The specifier for the property being animated
* @param startValue The starting value of the property
* @param byValue The amount by which the property will change
*/
private void animatePropertyBy(int constantName, float startValue, float byValue) {
// First, cancel any existing animations on this property
if (mAnimatorMap.size() > 0) {
Animator animatorToCancel = null;
Set<Animator> animatorSet = mAnimatorMap.keySet();
for (Animator runningAnim : animatorSet) {
PropertyBundle bundle = mAnimatorMap.get(runningAnim);
if (bundle.cancel(constantName)) {
// there can only ever be one such animation running.
if (bundle.mPropertyMask == NONE) {
// the animation is no longer changing anything - cancel it
animatorToCancel = runningAnim;
break;
}
}
}
if (animatorToCancel != null) {
animatorToCancel.cancel();
}
}
NameValuesHolder nameValuePair = new NameValuesHolder(constantName, startValue, byValue);
mPendingAnimations.add(nameValuePair);
View v = mView.get();
if (v != null) {
v.removeCallbacks(mAnimationStarter);
v.post(mAnimationStarter);
}
}
use of com.nineoldandroids.animation.Animator in project NineOldAndroids by JakeWharton.
the class ViewPropertyAnimatorPreHC method cancel.
@Override
public void cancel() {
if (mAnimatorMap.size() > 0) {
HashMap<Animator, PropertyBundle> mAnimatorMapCopy = (HashMap<Animator, PropertyBundle>) mAnimatorMap.clone();
Set<Animator> animatorSet = mAnimatorMapCopy.keySet();
for (Animator runningAnim : animatorSet) {
runningAnim.cancel();
}
}
mPendingAnimations.clear();
View v = mView.get();
if (v != null) {
v.removeCallbacks(mAnimationStarter);
}
}
use of com.nineoldandroids.animation.Animator in project appsly-android-rest by 47deg.
the class MainActivity method animateContent.
private void animateContent() {
ViewHelper.setRotation(imageViewIcon, 20);
ViewHelper.setTranslationY(imageViewIcon, -100);
ViewHelper.setTranslationX(textViewCity, 100);
ViewHelper.setAlpha(linearLayoutContent, 0);
ViewHelper.setTranslationY(descriptionTempContent, 200);
ViewHelper.setTranslationY(contentBottom, 200);
animate(imageViewIcon).setDuration(300).setInterpolator(new AccelerateInterpolator()).translationY(0).setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
iconFall(imageViewIcon, 10);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
}).start();
animate(textViewCity).setDuration(1000).setInterpolator(new AccelerateDecelerateInterpolator()).translationX(0).start();
animate(linearLayoutContent).setDuration(1000).alpha(1).start();
animate(contentBottom).setDuration(1000).translationY(0).start();
animate(descriptionTempContent).setDuration(1000).translationY(0).start();
}
use of com.nineoldandroids.animation.Animator in project PhotoNoter by yydcdut.
the class PhotoDetailActivity method showWidget.
@Override
public void showWidget(final IPhotoDetailPresenter.OnAnimationAdapter onAnimationAdapter) {
AnimatorSet animation = new AnimatorSet();
animation.setDuration(1000);
animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop() + getActionBarSize(), mBottomLayout.getTop()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", -getActionBarSize(), 0f));
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
if (onAnimationAdapter != null) {
onAnimationAdapter.onAnimationStarted(IPhotoDetailPresenter.STATE_SHOW);
}
}
@Override
public void onAnimationEnd(Animator animation) {
if (onAnimationAdapter != null) {
onAnimationAdapter.onAnimationEnded(IPhotoDetailPresenter.STATE_SHOW);
}
}
});
animation.start();
}
Aggregations