Search in sources :

Example 56 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project UltimateAndroid by cymcsg.

the class SwitchAnimationUtil method runRotateAnimation.

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

Example 57 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project mobile-android by photo.

the class BottombarViewFlipper method createInAnimation.

/**
	 * Creates the in animation.
	 * 
	 * @param deltaType
	 *           the delta type
	 * @param height
	 *           the height
	 * @param durationMillis
	 *           the duration millis
	 * @param startOffset
	 *           the start offset
	 * @return the animation
	 */
private Animation createInAnimation(int deltaType, int height, int durationMillis, int startOffset) {
    if (mAnimationIn == null) {
        mAnimationIn = new TranslateAnimation(deltaType, 0, deltaType, 0, deltaType, height, deltaType, 0);
        mAnimationIn.setDuration(durationMillis);
        mAnimationIn.setStartOffset(startOffset);
        mAnimationIn.setInterpolator(new AccelerateInterpolator(0.5f));
    }
    return mAnimationIn;
// return animation;
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation)

Example 58 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project CircularFloatingActionMenu by oguzbilgener.

the class SlideInAnimationHandler method animateMenuClosing.

@Override
public void animateMenuClosing(Point center) {
    super.animateMenuOpening(center);
    setAnimating(true);
    Animator lastAnimation = null;
    for (int i = 0; i < menu.getSubActionItems().size(); i++) {
        //            PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat(View.TRANSLATION_X, - (menu.getSubActionItems().get(i).x - center.x + menu.getSubActionItems().get(i).width / 2));
        PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, DIST_Y);
        //            PropertyValuesHolder pvhsX = PropertyValuesHolder.ofFloat(View.SCALE_X, 0);
        //            PropertyValuesHolder pvhsY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 0);
        PropertyValuesHolder pvhA = PropertyValuesHolder.ofFloat(View.ALPHA, 0);
        final ObjectAnimator animation = ObjectAnimator.ofPropertyValuesHolder(menu.getSubActionItems().get(i).view, pvhY, pvhA);
        animation.setDuration(DURATION);
        animation.setInterpolator(new AccelerateInterpolator());
        animation.addListener(new SubActionItemAnimationListener(menu.getSubActionItems().get(i), ActionType.CLOSING));
        if (i == 0) {
            lastAnimation = animation;
        }
        if (i <= menu.getSubActionItems().size() / 2) {
            animation.setStartDelay(i * LAG_BETWEEN_ITEMS);
        } else {
            animation.setStartDelay((menu.getSubActionItems().size() - i) * LAG_BETWEEN_ITEMS);
        }
        animation.start();
    }
    if (lastAnimation != null) {
        lastAnimation.addListener(new LastAnimationListener());
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ObjectAnimator(android.animation.ObjectAnimator) PropertyValuesHolder(android.animation.PropertyValuesHolder) Point(android.graphics.Point)

Example 59 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project android_frameworks_base by ResurrectionRemix.

the class VelocityTest method testDragAcceleration.

@MediumTest
public void testDragAcceleration() {
    long t = System.currentTimeMillis();
    VelocityTracker vt = VelocityTracker.obtain();
    drag(vt, 100, 200, 100, 200, 15, t, 400, new AccelerateInterpolator());
    vt.computeCurrentVelocity(1000);
    assertGreater(250.0f, vt.getXVelocity());
    assertGreater(250.0f, vt.getYVelocity());
    vt.recycle();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 60 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project android_frameworks_base by ResurrectionRemix.

the class PhoneStatusBar method setAreThereNotifications.

@Override
protected void setAreThereNotifications() {
    if (SPEW) {
        final boolean clearable = hasActiveNotifications() && hasActiveClearableNotifications();
        Log.d(TAG, "setAreThereNotifications: N=" + mNotificationData.getActiveNotifications().size() + " any=" + hasActiveNotifications() + " clearable=" + clearable);
    }
    final View nlo = mStatusBarView.findViewById(R.id.notification_lights_out);
    final boolean showDot = hasActiveNotifications() && !areLightsOn();
    if (showDot != (nlo.getAlpha() == 1.0f)) {
        if (showDot) {
            nlo.setAlpha(0f);
            nlo.setVisibility(View.VISIBLE);
        }
        nlo.animate().alpha(showDot ? 1 : 0).setDuration(showDot ? 750 : 250).setInterpolator(new AccelerateInterpolator(2.0f)).setListener(showDot ? null : new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator _a) {
                nlo.setVisibility(View.GONE);
            }
        }).start();
    }
    findAndUpdateMediaNotifications();
}
Also used : Animator(android.animation.Animator) StackStateAnimator(com.android.systemui.statusbar.stack.StackStateAnimator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView) BatteryMeterView(com.android.systemui.BatteryMeterView) DismissView(com.android.systemui.statusbar.DismissView) NotificationBackgroundView(com.android.systemui.statusbar.NotificationBackgroundView) VisualizerView(com.android.systemui.statusbar.VisualizerView) SignalClusterView(com.android.systemui.statusbar.SignalClusterView) KeyguardStatusView(com.android.keyguard.KeyguardStatusView) ImageView(android.widget.ImageView) BatteryLevelTextView(com.android.systemui.BatteryLevelTextView) BackDropView(com.android.systemui.statusbar.BackDropView) KeyButtonView(com.android.systemui.statusbar.policy.KeyButtonView) EmptyShadeView(com.android.systemui.statusbar.EmptyShadeView) View(android.view.View) TextView(android.widget.TextView) ScrimView(com.android.systemui.statusbar.ScrimView)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)186 Animator (android.animation.Animator)62 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)54 View (android.view.View)52 ObjectAnimator (android.animation.ObjectAnimator)41 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40 ImageView (android.widget.ImageView)26 AnimatorSet (android.animation.AnimatorSet)24 TextView (android.widget.TextView)23 Animation (android.view.animation.Animation)21 ValueAnimator (android.animation.ValueAnimator)17 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)14 OvershootInterpolator (android.view.animation.OvershootInterpolator)13 Point (android.graphics.Point)12 Paint (android.graphics.Paint)10 Interpolator (android.view.animation.Interpolator)9 AlphaAnimation (android.view.animation.AlphaAnimation)8 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)8