use of com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.
the class AnimateDismissAdapter method animateDismiss.
/**
* Animate dismissal of the items at given positions.
*/
public void animateDismiss(final Collection<Integer> positions) {
final List<Integer> positionsCopy = new ArrayList<Integer>(positions);
if (getAbsListView() == null) {
throw new IllegalStateException("Call setAbsListView() on this AnimateDismissAdapter before calling setAdapter()!");
}
List<View> views = getVisibleViewsForPositions(positionsCopy);
if (!views.isEmpty()) {
List<Animator> animators = new ArrayList<Animator>();
for (final View view : views) {
animators.add(createAnimatorForView(view));
}
AnimatorSet animatorSet = new AnimatorSet();
Animator[] animatorsArray = new Animator[animators.size()];
for (int i = 0; i < animatorsArray.length; i++) {
animatorsArray[i] = animators.get(i);
}
animatorSet.playTogether(animatorsArray);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animator) {
invokeCallback(positionsCopy);
}
});
animatorSet.start();
} else {
invokeCallback(positionsCopy);
}
}
use of com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.
the class ResideMenu method closeMenu.
/**
* close the reslide menu;
*/
public void closeMenu() {
isOpened = false;
AnimatorSet scaleUp_activity = buildScaleUpAnimation(viewActivity, 1.0f, 1.0f);
AnimatorSet scaleUp_shadow = buildScaleUpAnimation(imageViewShadow, 1.0f, 1.0f);
AnimatorSet alpha_menu = buildMenuAnimation(scrollViewMenu, 0.0f);
scaleUp_activity.addListener(animationListener);
scaleUp_activity.playTogether(scaleUp_shadow);
scaleUp_activity.playTogether(alpha_menu);
scaleUp_activity.start();
}
use of com.marshalchen.common.uimodule.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.
the class AnimationAdapter method animateView.
private void animateView(final ViewGroup parent, final View view) {
if (mAnimationStartMillis == -1) {
mAnimationStartMillis = System.currentTimeMillis();
}
ViewHelper.setAlpha(view, 0);
Animator[] childAnimators;
if (mDecoratedBaseAdapter instanceof AnimationAdapter) {
childAnimators = ((AnimationAdapter) mDecoratedBaseAdapter).getAnimators(parent, view);
} else {
childAnimators = new Animator[0];
}
Animator[] animators = getAnimators(parent, view);
Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);
AnimatorSet set = new AnimatorSet();
set.playTogether(concatAnimators(childAnimators, animators, alphaAnimator));
set.setStartDelay(calculateAnimationDelay());
set.setDuration(getAnimationDurationMillis());
set.start();
mAnimators.put(view.hashCode(), set);
}
Aggregations