use of com.nineoldandroids.animation.Animator in project ride-read-android by Ride-Read.
the class ShowPictureActivity method MoveView.
private void MoveView() {
ObjectAnimator.ofFloat(mainView, "alpha", 0.8f).setDuration(0).start();
mainView.setVisibility(View.VISIBLE);
AnimatorSet set = new AnimatorSet();
set.playTogether(ObjectAnimator.ofFloat(showImageView, "translationX", tx).setDuration(200), ObjectAnimator.ofFloat(showImageView, "translationY", ty).setDuration(200), ObjectAnimator.ofFloat(mainView, "alpha", 1).setDuration(200));
set.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
showImageView.setScaleType(ImageView.ScaleType.FIT_XY);
spring.setEndValue(1);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
set.start();
}
use of com.nineoldandroids.animation.Animator in project ride-read-android by Ride-Read.
the class ShowPictureActivity method MoveBackView.
private void MoveBackView() {
AnimatorSet set = new AnimatorSet();
set.playTogether(ObjectAnimator.ofFloat(showImageView, "translationX", to_x).setDuration(200), ObjectAnimator.ofFloat(showImageView, "translationY", to_y).setDuration(200));
set.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
finish();
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
set.start();
}
use of com.nineoldandroids.animation.Animator in project SunDay by iQuick.
the class SwipeListViewTouchListener method generateRevealAnimate.
/**
* Create reveal animation
*
* @param view affected view
* @param swap If will change state. If "false" returns to the original position
* @param swapRight If swap is true, this parameter tells if movement is toward right or left
* @param position list position
*/
private void generateRevealAnimate(final View view, final boolean swap, final boolean swapRight, final int position) {
int moveTo = 0;
if (opened.get(position)) {
if (!swap) {
moveTo = openedRight.get(position) ? (int) (viewWidth - rightOffset) : (int) (-viewWidth + leftOffset);
}
} else {
if (swap) {
moveTo = swapRight ? (int) (viewWidth - rightOffset) : (int) (-viewWidth + leftOffset);
}
}
animate(view).translationX(moveTo).setDuration(animationTime).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
swipeListView.resetScrolling();
if (swap) {
boolean aux = !opened.get(position);
opened.set(position, aux);
if (aux) {
swipeListView.onOpened(position, swapRight);
openedRight.set(position, swapRight);
} else {
swipeListView.onClosed(position, openedRight.get(position));
}
}
resetCell();
}
});
}
use of com.nineoldandroids.animation.Animator in project SunDay by iQuick.
the class SwipeListViewTouchListener method performDismiss.
/**
* Perform dismiss action
*
* @param dismissView View
* @param dismissPosition Position of list
*/
protected void performDismiss(final View dismissView, final int dismissPosition, boolean doPendingDismiss) {
final ViewGroup.LayoutParams lp = dismissView.getLayoutParams();
final int originalHeight = dismissView.getHeight();
ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 1).setDuration(animationTime);
if (doPendingDismiss) {
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
--dismissAnimationRefCount;
if (dismissAnimationRefCount == 0) {
removePendingDismisses(originalHeight);
}
}
});
}
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
lp.height = (Integer) valueAnimator.getAnimatedValue();
dismissView.setLayoutParams(lp);
}
});
pendingDismisses.add(new PendingDismissData(dismissPosition, dismissView));
animator.start();
}
use of com.nineoldandroids.animation.Animator in project AndroidSweetSheet by zzz40500.
the class Delegate method dismissShowdown.
/**
* 隐藏模糊背景
*/
protected void dismissShowdown() {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 1, 0);
objectAnimator.setDuration(400);
objectAnimator.start();
objectAnimator.addListener(new SimpleAnimationListener() {
@Override
public void onAnimationEnd(Animator animation) {
mParentVG.removeView(mBg);
}
});
}
Aggregations