use of com.nineoldandroids.animation.AnimatorSet 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();
}
use of com.nineoldandroids.animation.AnimatorSet in project XhsEmoticonsKeyboard by w446108264.
the class AnimEmoticonsIndicatorView method playTo.
public void playTo(int position, PageSetEntity pageSetEntity) {
if (!checkPageSetEntity(pageSetEntity)) {
return;
}
updateIndicatorCount(pageSetEntity.getPageCount());
for (ImageView iv : mImageViews) {
iv.setImageDrawable(mDrawableNomal);
}
mImageViews.get(position).setImageDrawable(mDrawableSelect);
final ImageView imageViewStrat = mImageViews.get(position);
ObjectAnimator animIn1 = ObjectAnimator.ofFloat(imageViewStrat, "scaleX", 0.25f, 1.0f);
ObjectAnimator animIn2 = ObjectAnimator.ofFloat(imageViewStrat, "scaleY", 0.25f, 1.0f);
if (mPlayToAnimatorSet != null && mPlayToAnimatorSet.isRunning()) {
mPlayToAnimatorSet.cancel();
mPlayToAnimatorSet = null;
}
mPlayToAnimatorSet = new AnimatorSet();
mPlayToAnimatorSet.play(animIn1).with(animIn2);
mPlayToAnimatorSet.setDuration(100);
mPlayToAnimatorSet.start();
}
use of com.nineoldandroids.animation.AnimatorSet in project android-shapeLoadingView by zzz40500.
the class LoadingView method upThrow.
/**
* 上抛
*/
public void upThrow() {
if (mUpAnimatorSet == null) {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mShapeLoadingView, "translationY", mDistance, 0);
ObjectAnimator scaleIndication = ObjectAnimator.ofFloat(mIndicationIm, "scaleX", 1f, 0.2f);
ObjectAnimator objectAnimator1 = null;
switch(mShapeLoadingView.getShape()) {
case SHAPE_RECT:
objectAnimator1 = ObjectAnimator.ofFloat(mShapeLoadingView, "rotation", 0, 180);
break;
case SHAPE_CIRCLE:
objectAnimator1 = ObjectAnimator.ofFloat(mShapeLoadingView, "rotation", 0, 180);
break;
case SHAPE_TRIANGLE:
objectAnimator1 = ObjectAnimator.ofFloat(mShapeLoadingView, "rotation", 0, 180);
break;
}
mUpAnimatorSet = new AnimatorSet();
mUpAnimatorSet.playTogether(objectAnimator, objectAnimator1, scaleIndication);
mUpAnimatorSet.setDuration(ANIMATION_DURATION);
mUpAnimatorSet.setInterpolator(new DecelerateInterpolator(FACTOR));
mUpAnimatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
if (!mStopped) {
freeFall();
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
mUpAnimatorSet.start();
}
use of com.nineoldandroids.animation.AnimatorSet in project Meizhi by drakeet.
the class FloatView method translationX.
public void translationX(float fromX, float toX, float formAlpha, final float toAlpha) {
ObjectAnimator a1 = ObjectAnimator.ofFloat(rootView, "alpha", formAlpha, toAlpha);
ObjectAnimator a2 = ObjectAnimator.ofFloat(rootView, "translationX", fromX, toX);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(a1, a2);
animatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
if (toAlpha == 0) {
HeadsUpManager.getInstant(getContext()).dismiss();
cutDown = -1;
if (velocityTracker != null) {
velocityTracker.clear();
try {
velocityTracker.recycle();
} catch (IllegalStateException e) {
}
}
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
animatorSet.start();
}
use of com.nineoldandroids.animation.AnimatorSet in project datetimepicker by flavienlaurent.
the class RadialPickerLayout method setCurrentItemShowing.
/**
* Set either minutes or hours as showing.
*
* @param animate True to animate the transition, false to show with no animation.
*/
public void setCurrentItemShowing(int index, boolean animate) {
if (index != HOUR_INDEX && index != MINUTE_INDEX) {
Log.e(TAG, "TimePicker does not support view at index " + index);
return;
}
//NineOldDroids does not work in this case due to dependency recursion.
//Don't animate on API 14
animate = animate && Build.VERSION.SDK_INT > 14;
int lastIndex = getCurrentItemShowing();
mCurrentItemShowing = index;
if (animate && (index != lastIndex)) {
ObjectAnimator[] anims = new ObjectAnimator[4];
if (index == MINUTE_INDEX) {
anims[0] = mHourRadialTextsView.getDisappearAnimator();
anims[1] = mHourRadialSelectorView.getDisappearAnimator();
anims[2] = mMinuteRadialTextsView.getReappearAnimator();
anims[3] = mMinuteRadialSelectorView.getReappearAnimator();
} else if (index == HOUR_INDEX) {
anims[0] = mHourRadialTextsView.getReappearAnimator();
anims[1] = mHourRadialSelectorView.getReappearAnimator();
anims[2] = mMinuteRadialTextsView.getDisappearAnimator();
anims[3] = mMinuteRadialSelectorView.getDisappearAnimator();
}
if (mTransition != null && mTransition.isRunning()) {
mTransition.end();
}
mTransition = new AnimatorSet();
mTransition.playTogether(anims);
mTransition.start();
} else {
if (Build.VERSION.SDK_INT >= 11) {
int hourAlpha = (index == HOUR_INDEX) ? 255 : 0;
int minuteAlpha = (index == MINUTE_INDEX) ? 255 : 0;
mHourRadialTextsView.setAlpha(hourAlpha);
mHourRadialSelectorView.setAlpha(hourAlpha);
mMinuteRadialTextsView.setAlpha(minuteAlpha);
mMinuteRadialSelectorView.setAlpha(minuteAlpha);
} else {
int hourVisibility = (index == HOUR_INDEX) ? View.VISIBLE : View.INVISIBLE;
int minuteVisibility = (index == MINUTE_INDEX) ? View.VISIBLE : View.INVISIBLE;
mHourRadialTextsView.setVisibility(hourVisibility);
mHourRadialSelectorView.setVisibility(hourVisibility);
mMinuteRadialTextsView.setVisibility(minuteVisibility);
mMinuteRadialSelectorView.setVisibility(minuteVisibility);
}
}
}
Aggregations