use of android.view.animation.DecelerateInterpolator in project Libraries-for-Android-Developers by eoecn.
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++) {
AnimatorProxy child = AnimatorProxy.wrap(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 android-app by eoecn.
the class XListView method initWithContext.
private void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
// XListView need the scroll event, and it will dispatch the event to
// user's listener (as a proxy).
super.setOnScrollListener(this);
// init header view
mHeaderView = new XListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
mHeaderTimeView = (TextView) mHeaderView.findViewById(R.id.xlistview_header_time);
addHeaderView(mHeaderView);
// init footer view
mFooterView = new XListViewFooter(context);
// init header height
mHeaderView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mHeaderViewHeight = mHeaderViewContent.getHeight();
getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
});
}
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();
}
});
}
use of android.view.animation.DecelerateInterpolator in project Meizhi by drakeet.
the class GankActivity method hideOrShowToolbar.
@Override
protected void hideOrShowToolbar() {
View toolbar = findViewById(R.id.toolbar_with_indicator);
assert toolbar != null;
toolbar.animate().translationY(mIsHidden ? 0 : -mToolbar.getHeight()).setInterpolator(new DecelerateInterpolator(2)).start();
mIsHidden = !mIsHidden;
if (mIsHidden) {
mViewPager.setTag(mViewPager.getPaddingTop());
mViewPager.setPadding(0, 0, 0, 0);
} else {
mViewPager.setPadding(0, (int) mViewPager.getTag(), 0, 0);
mViewPager.setTag(null);
}
}
use of android.view.animation.DecelerateInterpolator in project Launcher3 by chislon.
the class Workspace method animateBackgroundGradient.
private void animateBackgroundGradient(float finalAlpha, boolean animated) {
if (mBackground == null)
return;
if (mBackgroundFadeInAnimation != null) {
mBackgroundFadeInAnimation.cancel();
mBackgroundFadeInAnimation = null;
}
if (mBackgroundFadeOutAnimation != null) {
mBackgroundFadeOutAnimation.cancel();
mBackgroundFadeOutAnimation = null;
}
float startAlpha = getBackgroundAlpha();
if (finalAlpha != startAlpha) {
if (animated) {
mBackgroundFadeOutAnimation = LauncherAnimUtils.ofFloat(this, startAlpha, finalAlpha);
mBackgroundFadeOutAnimation.addUpdateListener(new AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
setBackgroundAlpha(((Float) animation.getAnimatedValue()).floatValue());
}
});
mBackgroundFadeOutAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
mBackgroundFadeOutAnimation.setDuration(BACKGROUND_FADE_OUT_DURATION);
mBackgroundFadeOutAnimation.start();
} else {
setBackgroundAlpha(finalAlpha);
}
}
}
Aggregations