Search in sources :

Example 36 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runFlipHorizonAnimation.

private void runFlipHorizonAnimation(View view, long delay) {
    view.setAlpha(0);
    AnimatorSet set = new AnimatorSet();
    ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(view, "rotationY", -180f, 0f);
    ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    set.setDuration(mDuration);
    set.playTogether(objectAnimator1, objectAnimator2);
    set.setStartDelay(delay);
    set.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 37 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runHorizonLeftAnimation.

private void runHorizonLeftAnimation(View view, long delay) {
    view.setAlpha(0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationX", -ViewUtils.getScreenWidth(), 0);
    objectAnimator.setInterpolator(new LinearInterpolator());
    ObjectAnimator objectAnimatorAlpha = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    AnimatorSet set = new AnimatorSet();
    set.setDuration(mDuration);
    set.setStartDelay(delay);
    set.playTogether(objectAnimator, objectAnimatorAlpha);
    set.start();
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 38 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runScaleAnimation.

private void runScaleAnimation(View view, long delay) {
    view.setAlpha(0);
    AnimatorSet set = new AnimatorSet();
    ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, "scaleX", 0f, 1f);
    ObjectAnimator objectAnimator3 = ObjectAnimator.ofFloat(view, "scaleY", 0f, 1f);
    ObjectAnimator objectAnimator4 = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    set.setDuration(mDuration);
    set.playTogether(objectAnimator2, objectAnimator3, objectAnimator4);
    set.setStartDelay(delay);
    set.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 39 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project AndroidViewHover by daimajia.

the class BlurLayout method startBlurImageAppearAnimator.

private void startBlurImageAppearAnimator() {
    if (!enableBlurBackground || mBlurImage == null)
        return;
    AnimatorSet set = new AnimatorSet();
    if (enableBackgroundZoom) {
        set.playTogether(ObjectAnimator.ofFloat(mBlurImage, "alpha", 0.8f, 1f), ObjectAnimator.ofFloat(mBlurImage, "scaleX", 1f, mZoomRatio), ObjectAnimator.ofFloat(mBlurImage, "scaleY", 1f, mZoomRatio));
    } else {
        set.playTogether(ObjectAnimator.ofFloat(mBlurImage, "alpha", 0f, 1f));
    }
    set.addListener(mGlobalListener);
    set.addListener(mGlobalAppearingAnimators);
    set.setDuration(mBlurDuration);
    set.start();
}
Also used : AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 40 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project android-betterpickers by code-troopers.

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;
    }
    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 {
        int hourAlpha = (index == HOUR_INDEX) ? 255 : 0;
        int minuteAlpha = (index == MINUTE_INDEX) ? 255 : 0;
        ViewHelper.setAlpha(mHourRadialTextsView, hourAlpha);
        ViewHelper.setAlpha(mHourRadialSelectorView, hourAlpha);
        ViewHelper.setAlpha(mMinuteRadialTextsView, minuteAlpha);
        ViewHelper.setAlpha(mMinuteRadialSelectorView, minuteAlpha);
    }
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet) SuppressLint(android.annotation.SuppressLint)

Aggregations

AnimatorSet (com.nineoldandroids.animation.AnimatorSet)57 ObjectAnimator (com.nineoldandroids.animation.ObjectAnimator)42 Animator (com.nineoldandroids.animation.Animator)24 AnimatorListenerAdapter (com.nineoldandroids.animation.AnimatorListenerAdapter)11 View (android.view.View)6 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)4 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)4 SuppressLint (android.annotation.SuppressLint)3 Paint (android.graphics.Paint)3 OvershootInterpolator (android.view.animation.OvershootInterpolator)3 Point (android.graphics.Point)2 DisplayMetrics (android.util.DisplayMetrics)2 LinearInterpolator (android.view.animation.LinearInterpolator)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)2 IDetailView (com.yydcdut.note.views.note.IDetailView)2 FontTextView (com.yydcdut.note.widget.FontTextView)2 RevealView (com.yydcdut.note.widget.RevealView)2