use of android.view.animation.LinearInterpolator in project android_packages_apps_DUI by DirtyUnicorns.
the class FlingLogoController method getSpinAnimation.
public static AnimationSet getSpinAnimation(int mode) {
final boolean makeHidden = mode == LOGO_ANIMATE_HIDE;
final float from = makeHidden ? 1.0f : 0.0f;
final float to = makeHidden ? 0.0f : 1.0f;
final float fromDeg = makeHidden ? 0.0f : 360.0f;
final float toDeg = makeHidden ? 360.0f : 0.0f;
Animation scale = new ScaleAnimation(from, to, from, to, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
RotateAnimation rotate = new RotateAnimation(fromDeg, toDeg, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
AnimationSet animSet = new AnimationSet(true);
animSet.setInterpolator(new LinearInterpolator());
animSet.setDuration(150);
animSet.setFillAfter(true);
animSet.addAnimation(scale);
animSet.addAnimation(rotate);
return animSet;
}
use of android.view.animation.LinearInterpolator in project Ushahidi_Android by ushahidi.
the class IcsProgressBar method startAnimation.
/**
* <p>Start the indeterminate progress animation.</p>
*/
void startAnimation() {
if (getVisibility() != VISIBLE) {
return;
}
if (mIndeterminateDrawable instanceof Animatable) {
mShouldStartAnimationDrawable = true;
mAnimation = null;
} else {
if (mInterpolator == null) {
mInterpolator = new LinearInterpolator();
}
mTransformation = new Transformation();
mAnimation = new AlphaAnimation(0.0f, 1.0f);
mAnimation.setRepeatMode(mBehavior);
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setDuration(mDuration);
mAnimation.setInterpolator(mInterpolator);
mAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
}
postInvalidate();
}
use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.
the class AnimationLaunch method onCreate.
@Override
protected void onCreate(WelcomeCoordinatorLayout coordinator) {
objectAnimatorY = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_Y, 0, -getTargetView().getTop() - getTargetView().getHeight());
objectAnimatorY.setDuration(DURATION);
objectAnimatorY.setInterpolator(new LinearInterpolator());
objectAnimatorX = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_X, 0, coordinatorLayout.getWidth());
objectAnimatorX.setDuration(DURATION);
objectAnimatorX.setInterpolator(new LinearInterpolator());
}
use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.
the class ParallaxTitleBehaviour method onCreate.
@Override
protected void onCreate(WelcomeCoordinatorLayout coordinator) {
final FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) getPage().getLayoutParams();
long startDelay;
long duration;
float rightTranslation;
float leftTranslation;
if (params.leftMargin == 0) {
startDelay = 0;
duration = getPage().getMeasuredWidth();
rightTranslation = 0;
leftTranslation = -(duration / PARALLAX_FACTOR);
} else {
startDelay = (params.leftMargin - coordinator.getMeasuredWidth());
duration = (getPage().getMeasuredWidth() * 2);
rightTranslation = (duration / PARALLAX_FACTOR);
leftTranslation = -(duration / PARALLAX_FACTOR);
}
parallaxAnimator = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_X, rightTranslation, leftTranslation);
parallaxAnimator.setInterpolator(new LinearInterpolator());
parallaxAnimator.setTarget(getTargetView());
parallaxAnimator.setStartDelay(startDelay);
parallaxAnimator.setDuration(duration);
}
use of android.view.animation.LinearInterpolator in project welcome-coordinator by txusballesteros.
the class InSyncAnimator method initializeAnimator.
private void initializeAnimator() {
final View avatarView = rootView.findViewById(R.id.avatar5);
final View arrowChartMaskView = rootView.findViewById(R.id.arrow_chart_mask);
final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(avatarView, View.SCALE_X, 0f, 1f);
scaleXAnimator.setDuration(300);
scaleXAnimator.setInterpolator(new OvershootInterpolator());
final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(avatarView, View.SCALE_Y, 0f, 1f);
scaleYAnimator.setDuration(300);
scaleYAnimator.setInterpolator(new OvershootInterpolator());
final ObjectAnimator maskScaleXAnimator = ObjectAnimator.ofFloat(arrowChartMaskView, View.SCALE_X, 1f, 0f);
maskScaleXAnimator.setDuration(500);
maskScaleXAnimator.setInterpolator(new LinearInterpolator());
animator = new AnimatorSet();
animator.play(scaleXAnimator).with(scaleYAnimator).before(maskScaleXAnimator);
}
Aggregations