use of android.view.animation.DecelerateInterpolator in project ViewAnimator by florent37.
the class MainActivity method animateSequentially.
protected void animateSequentially() {
ViewAnimator.animate(image).dp().width(100f, 150f).alpha(1, 0.1f).interpolator(new DecelerateInterpolator()).duration(800).thenAnimate(image).dp().width(150f, 100f).alpha(0.1f, 1f).interpolator(new AccelerateInterpolator()).duration(1200).start();
ViewAnimator.animate(image).scaleX(0, 1).scaleY(0, 1).alpha(0, 1).decelerate().duration(500).thenAnimate(image).scaleX(1, 0).scaleY(1, 0).alpha(1, 0).accelerate().duration(500);
}
use of android.view.animation.DecelerateInterpolator in project cardslib by gabrielemariotti.
the class BaseActivity method onActionBarAutoShowOrHide.
protected void onActionBarAutoShowOrHide(boolean shown) {
if (mStatusBarColorAnimator != null) {
mStatusBarColorAnimator.cancel();
}
mStatusBarColorAnimator = ObjectAnimator.ofInt((mDrawerLayout != null) ? mDrawerLayout : mLPreviewUtils, (mDrawerLayout != null) ? "statusBarBackgroundColor" : "statusBarColor", shown ? Color.BLACK : mNormalStatusBarColor, shown ? mNormalStatusBarColor : Color.BLACK).setDuration(250);
if (mDrawerLayout != null) {
mStatusBarColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
ViewCompat.postInvalidateOnAnimation(mDrawerLayout);
}
});
}
mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR);
mStatusBarColorAnimator.start();
for (View view : mHideableHeaderViews) {
if (shown) {
view.animate().translationY(0).alpha(1).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
} else {
view.animate().translationY(-view.getBottom()).alpha(0).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
}
}
}
use of android.view.animation.DecelerateInterpolator in project xUtils3 by wyouflf.
the class ImageAnimationHelper method fadeInDisplay.
public static void fadeInDisplay(final ImageView imageView, Drawable drawable) {
AlphaAnimation fadeAnimation = new AlphaAnimation(0F, 1F);
fadeAnimation.setDuration(300);
fadeAnimation.setInterpolator(new DecelerateInterpolator());
imageView.setImageDrawable(drawable);
imageView.startAnimation(fadeAnimation);
}
use of android.view.animation.DecelerateInterpolator in project XobotOS by xamarin.
the class ActionBarContextView method makeInAnimation.
private Animator makeInAnimation() {
mClose.setTranslationX(-mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", 0);
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 = count - 1, j = 0; i >= 0; i--, j++) {
View child = mMenuView.getChildAt(i);
child.setScaleY(0);
ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0, 1);
a.setDuration(100);
a.setStartDelay(j * 70);
b.with(a);
}
}
}
return set;
}
use of android.view.animation.DecelerateInterpolator in project ViewInspector by xfumihiro.
the class ViewInspectorToolbar method onAttachedToWindow.
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mToolbar = findViewById(R.id.toolbar);
mToggleButton = (ImageButton) findViewById(R.id.toggle_menu);
ImageButton buttonBoundaryMenu = (ImageButton) findViewById(R.id.outline_menu);
ImageButton buttonLayerMenu = (ImageButton) findViewById(R.id.layer_menu);
ImageButton buttonEventMenu = (ImageButton) findViewById(R.id.event_menu);
ImageButton buttonSettingsMenu = (ImageButton) findViewById(R.id.settings_menu);
mToolbar.setTranslationX(mToolbarWidth);
ObjectAnimator animator = ObjectAnimator.ofFloat(mToolbar, "translationX", mToolbarWidth, mToolbarWidth - mToolbarClosedWidth);
animator.setInterpolator(new DecelerateInterpolator());
animator.start();
mToggleButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
closeMenu();
toggleToolbar();
}
});
buttonBoundaryMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof BoundaryMenu)) {
closeMenu();
mMenu = new BoundaryMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonLayerMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof LayerMenu)) {
closeMenu();
mMenu = new LayerMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonEventMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof EventMenu)) {
closeMenu();
mMenu = new EventMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonSettingsMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof SettingsMenu)) {
closeMenu();
mMenu = new SettingsMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
}
Aggregations