use of android.view.animation.OvershootInterpolator in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FloatingActionsMenu method createAddButton.
private void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
void updateBackground() {
mPlusColor = mAddButtonPlusColor;
mColorNormal = mAddButtonColorNormal;
mColorPressed = mAddButtonColorPressed;
mStrokeVisible = mAddButtonStrokeVisible;
super.updateBackground();
}
@Override
Drawable getIconDrawable() {
final RotatingDrawable rotatingDrawable = new RotatingDrawable(super.getIconDrawable());
mRotatingDrawable = rotatingDrawable;
final OvershootInterpolator interpolator = new OvershootInterpolator();
final ObjectAnimator collapseAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);
final ObjectAnimator expandAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);
collapseAnimator.setInterpolator(interpolator);
expandAnimator.setInterpolator(interpolator);
mExpandAnimation.play(expandAnimator);
mCollapseAnimation.play(collapseAnimator);
return rotatingDrawable;
}
};
mAddButton.setId(R.id.fab_expand_menu_button);
mAddButton.setSize(mAddButtonSize);
mAddButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggle();
}
});
addView(mAddButton, super.generateDefaultLayoutParams());
mButtonsCount++;
}
use of android.view.animation.OvershootInterpolator in project smartmodule by carozhu.
the class AnimationController method setEffect.
private void setEffect(Animation animation, int interpolatorType, long durationMillis, long delayMillis) {
switch(interpolatorType) {
case 0:
animation.setInterpolator(new LinearInterpolator());
break;
case 1:
animation.setInterpolator(new AccelerateInterpolator());
break;
case 2:
animation.setInterpolator(new DecelerateInterpolator());
break;
case 3:
animation.setInterpolator(new AccelerateDecelerateInterpolator());
break;
case 4:
animation.setInterpolator(new BounceInterpolator());
break;
case 5:
animation.setInterpolator(new OvershootInterpolator());
break;
case 6:
animation.setInterpolator(new AnticipateInterpolator());
break;
case 7:
animation.setInterpolator(new AnticipateOvershootInterpolator());
break;
default:
break;
}
animation.setDuration(durationMillis);
animation.setStartOffset(delayMillis);
}
use of android.view.animation.OvershootInterpolator in project android_frameworks_base by crdroidandroid.
the class QSPanel method setAnimationTile.
private void setAnimationTile(TileRecord r) {
ObjectAnimator animTile = null;
int animStyle = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_STYLE, 0, UserHandle.USER_CURRENT);
int animDuration = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_DURATION, 2000, UserHandle.USER_CURRENT);
int interpolatorType = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_INTERPOLATOR, 0, UserHandle.USER_CURRENT);
if (animStyle == 0) {
//No animation
}
if (animStyle == 1) {
animTile = ObjectAnimator.ofFloat(r.tileView, "rotationY", 0f, 360f);
}
if (animStyle == 2) {
animTile = ObjectAnimator.ofFloat(r.tileView, "rotation", 0f, 360f);
}
if (animTile != null) {
switch(interpolatorType) {
case 0:
animTile.setInterpolator(new LinearInterpolator());
break;
case 1:
animTile.setInterpolator(new AccelerateInterpolator());
break;
case 2:
animTile.setInterpolator(new DecelerateInterpolator());
break;
case 3:
animTile.setInterpolator(new AccelerateDecelerateInterpolator());
break;
case 4:
animTile.setInterpolator(new BounceInterpolator());
break;
case 5:
animTile.setInterpolator(new OvershootInterpolator());
break;
case 6:
animTile.setInterpolator(new AnticipateInterpolator());
break;
case 7:
animTile.setInterpolator(new AnticipateOvershootInterpolator());
break;
default:
break;
}
animTile.setDuration(animDuration);
animTile.start();
}
}
Aggregations