use of android.animation.PropertyValuesHolder in project TextSurface by elevenetc.
the class Slide method start.
@Override
public void start(@Nullable final IEndListener listener) {
text.setAlpha(255);
PropertyValuesHolder hHolder = null;
PropertyValuesHolder vHolder = null;
float fromX = 0;
float toX = 0;
float fromY = 0;
float toY = 0;
if ((side & Side.LEFT) == side) {
if (toShow) {
fromX = -text.getWidth();
} else {
toX = -text.getWidth();
}
hHolder = PropertyValuesHolder.ofFloat("xOffset", fromX, toX);
} else if ((side & Side.RIGHT) == side) {
if (toShow) {
fromX = text.getWidth();
} else {
toX = text.getWidth();
}
hHolder = PropertyValuesHolder.ofFloat("xOffset", fromX, toX);
}
if ((side & Side.TOP) == side) {
if (toShow) {
fromY = -text.getHeight();
} else {
toY = -text.getHeight();
}
vHolder = PropertyValuesHolder.ofFloat("yOffset", fromY, toY);
} else if ((side & Side.BOTTOM) == side) {
if (toShow) {
fromY = text.getHeight();
} else {
toY = text.getHeight();
}
vHolder = PropertyValuesHolder.ofFloat("yOffset", fromY, toY);
}
if (hHolder != null && vHolder != null) {
animator = ObjectAnimator.ofPropertyValuesHolder(this, hHolder, vHolder);
} else if (hHolder != null) {
animator = ObjectAnimator.ofPropertyValuesHolder(this, hHolder);
} else {
animator = ObjectAnimator.ofPropertyValuesHolder(this, vHolder);
}
animator.setInterpolator(new FastOutSlowInInterpolator());
Utils.addEndListener(this, animator, new IEndListener() {
@Override
public void onAnimationEnd(ISurfaceAnimation animation) {
text.removeEffect(Slide.this);
if (!toShow)
text.setAlpha(0);
if (listener != null)
listener.onAnimationEnd(Slide.this);
}
});
animator.setDuration(duration);
animator.addUpdateListener(this);
animator.start();
}
use of android.animation.PropertyValuesHolder in project TextSurface by elevenetc.
the class TransSurface method start.
@Override
public void start(@Nullable final IEndListener listener) {
float fromX = camera.getTransX();
float fromY = camera.getTransY();
float toX;
float toY;
if (textPivot == null) {
toX = camera.getTransX() + dx;
toY = camera.getTransY() + dy;
} else {
toX = textPivot.getPosition().getRelativeX(pivot, textPivot, true) * camera.getScale() * -1;
toY = textPivot.getPosition().getRelativeY(pivot, textPivot, true) * camera.getScale() * -1;
}
debugTranslation(fromX, fromY, toX, toY);
PropertyValuesHolder dxHolder = PropertyValuesHolder.ofFloat("transX", fromX, toX);
PropertyValuesHolder dyHolder = PropertyValuesHolder.ofFloat("transY", fromY, toY);
animator = ObjectAnimator.ofPropertyValuesHolder(camera, dxHolder, dyHolder);
animator.setInterpolator(new FastOutSlowInInterpolator());
Utils.addEndListener(this, animator, listener);
animator.setDuration(duration);
animator.addUpdateListener(this);
animator.start();
}
use of android.animation.PropertyValuesHolder in project XRecyclerView by jianghejie.
the class SquareSpinIndicator method createAnimation.
@Override
public List<Animator> createAnimation() {
List<Animator> animators = new ArrayList<>();
PropertyValuesHolder rotation5 = PropertyValuesHolder.ofFloat("rotationX", 0, 180, 180, 0, 0);
PropertyValuesHolder rotation6 = PropertyValuesHolder.ofFloat("rotationY", 0, 0, 180, 180, 0);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6, rotation5);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
animator.start();
animators.add(animator);
return animators;
}
use of android.animation.PropertyValuesHolder in project XRecyclerView by jianghejie.
the class TriangleSkewSpinIndicator method createAnimation.
@Override
public List<Animator> createAnimation() {
List<Animator> animators = new ArrayList<>();
PropertyValuesHolder rotation5 = PropertyValuesHolder.ofFloat("rotationX", 0, 180, 180, 0, 0);
PropertyValuesHolder rotation6 = PropertyValuesHolder.ofFloat("rotationY", 0, 0, 180, 180, 0);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6, rotation5);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
animator.start();
animators.add(animator);
return animators;
}
use of android.animation.PropertyValuesHolder in project XRecyclerView by jianghejie.
the class BallPulseRiseIndicator method createAnimation.
@Override
public List<Animator> createAnimation() {
PropertyValuesHolder rotation6 = PropertyValuesHolder.ofFloat("rotationX", 0, 360);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(1500);
animator.start();
List<Animator> animators = new ArrayList<>();
animators.add(animator);
return animators;
}
Aggregations