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();
}
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;
}
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());
}
}
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();
}
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();
}
Aggregations