use of android.view.animation.AnticipateOvershootInterpolator in project android_frameworks_base by ResurrectionRemix.
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();
}
}
use of android.view.animation.AnticipateOvershootInterpolator in project android_frameworks_base by DirtyUnicorns.
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();
}
}
use of android.view.animation.AnticipateOvershootInterpolator in project android_frameworks_base by crdroidandroid.
the class DessertCaseView method place.
public synchronized void place(View v, Point pt, boolean animate) {
final int i = pt.x;
final int j = pt.y;
final float rnd = frand();
if (v.getTag(TAG_POS) != null) {
for (final Point oc : getOccupied(v)) {
mFreeList.add(oc);
mCells[oc.y * mColumns + oc.x] = null;
}
}
int scale = 1;
if (rnd < PROB_4X) {
if (!(i >= mColumns - 3 || j >= mRows - 3)) {
scale = 4;
}
} else if (rnd < PROB_3X) {
if (!(i >= mColumns - 2 || j >= mRows - 2)) {
scale = 3;
}
} else if (rnd < PROB_2X) {
if (!(i == mColumns - 1 || j == mRows - 1)) {
scale = 2;
}
}
v.setTag(TAG_POS, pt);
v.setTag(TAG_SPAN, scale);
tmpSet.clear();
final Point[] occupied = getOccupied(v);
for (final Point oc : occupied) {
final View squatter = mCells[oc.y * mColumns + oc.x];
if (squatter != null) {
tmpSet.add(squatter);
}
}
for (final View squatter : tmpSet) {
for (final Point sq : getOccupied(squatter)) {
mFreeList.add(sq);
mCells[sq.y * mColumns + sq.x] = null;
}
if (squatter != v) {
squatter.setTag(TAG_POS, null);
if (animate) {
squatter.animate().withLayer().scaleX(0.5f).scaleY(0.5f).alpha(0).setDuration(DURATION).setInterpolator(new AccelerateInterpolator()).setListener(new Animator.AnimatorListener() {
public void onAnimationStart(Animator animator) {
}
public void onAnimationEnd(Animator animator) {
removeView(squatter);
}
public void onAnimationCancel(Animator animator) {
}
public void onAnimationRepeat(Animator animator) {
}
}).start();
} else {
removeView(squatter);
}
}
}
for (final Point oc : occupied) {
mCells[oc.y * mColumns + oc.x] = v;
mFreeList.remove(oc);
}
final float rot = (float) irand(0, 4) * 90f;
if (animate) {
v.bringToFront();
AnimatorSet set1 = new AnimatorSet();
set1.playTogether(ObjectAnimator.ofFloat(v, View.SCALE_X, (float) scale), ObjectAnimator.ofFloat(v, View.SCALE_Y, (float) scale));
set1.setInterpolator(new AnticipateOvershootInterpolator());
set1.setDuration(DURATION);
AnimatorSet set2 = new AnimatorSet();
set2.playTogether(ObjectAnimator.ofFloat(v, View.ROTATION, rot), ObjectAnimator.ofFloat(v, View.X, i * mCellSize + (scale - 1) * mCellSize / 2), ObjectAnimator.ofFloat(v, View.Y, j * mCellSize + (scale - 1) * mCellSize / 2));
set2.setInterpolator(new DecelerateInterpolator());
set2.setDuration(DURATION);
set1.addListener(makeHardwareLayerListener(v));
set1.start();
set2.start();
} else {
v.setX(i * mCellSize + (scale - 1) * mCellSize / 2);
v.setY(j * mCellSize + (scale - 1) * mCellSize / 2);
v.setScaleX((float) scale);
v.setScaleY((float) scale);
v.setRotation(rot);
}
}
use of android.view.animation.AnticipateOvershootInterpolator 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();
}
}
use of android.view.animation.AnticipateOvershootInterpolator in project RxTools by vondear.
the class RxAnimationTool method popout.
public static ObjectAnimator popout(final View view, final long duration, final AnimatorListenerAdapter animatorListenerAdapter) {
ObjectAnimator popout = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat("alpha", 1f, 0f), PropertyValuesHolder.ofFloat("scaleX", 1f, 0f), PropertyValuesHolder.ofFloat("scaleY", 1f, 0f));
popout.setDuration(duration);
popout.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
view.setVisibility(View.GONE);
if (animatorListenerAdapter != null) {
animatorListenerAdapter.onAnimationEnd(animation);
}
}
});
popout.setInterpolator(new AnticipateOvershootInterpolator());
return popout;
}
Aggregations