use of android.view.animation.DecelerateInterpolator in project cw-omnibus by commonsguy.
the class ActionBarContextView method makeOutAnimation.
private Animator makeOutAnimation() {
ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
buttonAnimator.setDuration(200);
buttonAnimator.addListener(this);
buttonAnimator.setInterpolator(new DecelerateInterpolator());
AnimatorSet set = new AnimatorSet();
AnimatorSet.Builder b = set.play(buttonAnimator);
if (mMenuView != null) {
final int count = mMenuView.getChildCount();
if (count > 0) {
for (int i = 0; i < 0; i++) {
AnimatorProxy child = AnimatorProxy.wrap(mMenuView.getChildAt(i));
child.setScaleY(0);
ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
a.setDuration(100);
a.setStartDelay(i * 70);
b.with(a);
}
}
}
return set;
}
use of android.view.animation.DecelerateInterpolator in project Launcher3 by chislon.
the class DeleteDropTarget method animateToTrashAndCompleteDrop.
private void animateToTrashAndCompleteDrop(final DragObject d) {
final DragLayer dragLayer = mLauncher.getDragLayer();
final Rect from = new Rect();
dragLayer.getViewRectRelativeToSelf(d.dragView, from);
final Rect to = getIconRect(d.dragView.getMeasuredWidth(), d.dragView.getMeasuredHeight(), mCurrentDrawable.getIntrinsicWidth(), mCurrentDrawable.getIntrinsicHeight());
final float scale = (float) to.width() / from.width();
mSearchDropTargetBar.deferOnDragEnd();
deferCompleteDropIfUninstalling(d);
Runnable onAnimationEndRunnable = new Runnable() {
@Override
public void run() {
completeDrop(d);
mSearchDropTargetBar.onDragEnd();
mLauncher.exitSpringLoadedDragMode();
}
};
dragLayer.animateView(d.dragView, from, to, scale, 1f, 1f, 0.1f, 0.1f, DELETE_ANIMATION_DURATION, new DecelerateInterpolator(2), new LinearInterpolator(), onAnimationEndRunnable, DragLayer.ANIMATION_END_DISAPPEAR, null);
}
use of android.view.animation.DecelerateInterpolator in project OneClickAndroid by cyngn.
the class UsbActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OneClickStats.sendEvent(this, OneClickStats.Categories.PAGE_SHOWN, OneClickStats.Actions.PAGE_ADB);
if (adbIsEnabled()) {
startActivity(new Intent(getBaseContext(), PtpActivity.class));
finish();
return;
}
setContentView(R.layout.usb);
ImageView instructionView = (ImageView) findViewById(R.id.usb_instructions);
DecelerateInterpolator interpolator = new DecelerateInterpolator(2.0f);
AnimationSet instructionAnimations = new AnimationSet(true);
instructionAnimations.setInterpolator(interpolator);
TranslateAnimation instructionMoveAnimation = new TranslateAnimation(0, 0, 250, 0);
instructionMoveAnimation.setDuration(1000);
instructionMoveAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionMoveAnimation);
// we want them to read the instructions first! so we give them a few seconds
AlphaAnimation instructionFadeAnimation = new AlphaAnimation(0.0f, 1.0f);
instructionFadeAnimation.setDuration(1000);
instructionFadeAnimation.setStartOffset(500);
instructionFadeAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionFadeAnimation);
instructionView.setAnimation(instructionAnimations);
// continue button should take even longer
AlphaAnimation buttonAnimation = new AlphaAnimation(0.0f, 1.0f);
buttonAnimation.setDuration(750);
buttonAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
buttonAnimation.setStartOffset(1000);
findViewById(R.id.next).setAnimation(buttonAnimation);
OnClickListener openUsbListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings");
try {
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.BUTTON_CLICK, OneClickStats.Actions.BTN_ADB);
startActivity(intent);
startService(new Intent(getBaseContext(), UsbDebuggingMonitorService.class));
} catch (ActivityNotFoundException e) {
// we want to know if this happens, right?
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.SWITCH_ERROR, OneClickStats.Actions.ERR_ADB);
}
}
};
findViewById(R.id.next).setOnClickListener(openUsbListener);
}
use of android.view.animation.DecelerateInterpolator in project WilliamChart by diogobernardino.
the class StackedCardThree method show.
@Override
public void show(Runnable action) {
super.show(action);
BarSet dataset = new BarSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#687E8E"));
mChart.addData(dataset);
dataset = new BarSet(mLabels, mValues[1]);
dataset.setColor(Color.parseColor("#FF5C8E67"));
mChart.addData(dataset);
mChart.setRoundCorners(Tools.fromDpToPx(5));
mChart.setBarSpacing(Tools.fromDpToPx(5));
mChart.setBorderSpacing(Tools.fromDpToPx(5)).setYLabels(AxisRenderer.LabelPosition.NONE).setXLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setAxisBorderValues(-80, 80, 10);
Animation anim = new Animation().setEasing(new DecelerateInterpolator()).setEndAction(action);
mChart.show(anim);
}
use of android.view.animation.DecelerateInterpolator in project ActivityAnimationLib by dkmeteor.
the class SplitEffect method animate.
public void animate(final Activity destActivity, final int duration) {
final Interpolator interpolator = new DecelerateInterpolator();
destActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
new Handler().post(new Runnable() {
@Override
public void run() {
mSetAnim = new AnimatorSet();
mTopImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mBottomImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mSetAnim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
clean(destActivity);
}
@Override
public void onAnimationCancel(Animator animation) {
clean(destActivity);
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
Animator anim1 = ObjectAnimator.ofFloat(mTopImage, "translationY", mTopImage.getHeight() * -1);
Animator anim2 = ObjectAnimator.ofFloat(mBottomImage, "translationY", mBottomImage.getHeight());
if (interpolator != null) {
anim1.setInterpolator(interpolator);
anim2.setInterpolator(interpolator);
}
mSetAnim.setDuration(duration);
mSetAnim.playTogether(anim1, anim2);
mSetAnim.start();
}
});
}
Aggregations