use of android.animation.Animator in project StarWars.Android by Yalantis.
the class SideFragment method createCheckoutRevealAnimator.
protected Animator createCheckoutRevealAnimator(final ClipRevealFrame view, int x, int y, float startRadius, float endRadius) {
setMenuVisibility(false);
Animator retAnimator;
mRadius = endRadius;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
retAnimator = ViewAnimationUtils.createCircularReveal(view, x, y, startRadius, endRadius);
} else {
view.setClipOutLines(true);
view.setClipCenter(x, y);
view.setClipRadius(startRadius);
retAnimator = ObjectAnimator.ofFloat(view, "clipRadius", startRadius, endRadius);
}
retAnimator.setDuration(ANIM_DURATION);
retAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
view.setClipOutLines(false);
removeOldSideFragment();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
retAnimator.setInterpolator(new AccelerateInterpolator(2.0f));
return retAnimator;
}
use of android.animation.Animator in project StarWars.Android by Yalantis.
the class StarWarsRenderer method startAnimation.
public void startAnimation() {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
// plane height
animator = ValueAnimator.ofFloat(0, -Const.PLANE_HEIGHT * 2);
animator.setDuration(mAnimationDuration);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
deltaPosX = value;
mGlSurfaceView.requestRender();
}
});
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
mGlSurfaceView.requestRender();
}
@Override
public void onAnimationEnd(Animator animation) {
mListener.onAnimationFinished();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
animator.start();
}
});
}
use of android.animation.Animator in project actor-platform by actorapp.
the class AttachFragment method hide.
@Override
public void hide() {
if (root != null && root.getVisibility() == View.VISIBLE) {
onHidden();
fastAttachAdapter.clearSelected();
messenger().getGalleryScannerActor().send(new GalleryScannerActor.Hide());
fastShare.scrollToPosition(0);
hideView(root);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP && !isFastShareFullScreen) {
View internal = fastShare;
int cx = internal.getWidth() - Screen.dp(56 + 56);
int cy = internal.getHeight() - Screen.dp(56 / 2);
float finalRadius = (float) Math.hypot(cx, cy);
Animator anim = ViewAnimationUtils.createCircularReveal(internal, cx, cy, finalRadius, 0);
anim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
internal.setAlpha(1);
}
@Override
public void onAnimationEnd(Animator animator) {
internal.setAlpha(0);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
anim.setDuration(200);
anim.start();
} else {
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, root.getHeight());
animation.setInterpolator(MaterialInterpolator.getInstance());
animation.setDuration(250);
fastShare.startAnimation(animation);
bottomBackground.startAnimation(animation);
}
}
}
use of android.animation.Animator in project lottie-android by airbnb.
the class AnimationFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_animation, container, false);
ButterKnife.bind(this, view);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getFragmentManager().popBackStack();
}
});
postUpdatePlayButtonText();
onLoopChanged();
animationView.addAnimatorListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
startRecordingDroppedFrames();
}
@Override
public void onAnimationEnd(Animator animation) {
recordDroppedFrames();
postUpdatePlayButtonText();
}
@Override
public void onAnimationCancel(Animator animation) {
postUpdatePlayButtonText();
}
@Override
public void onAnimationRepeat(Animator animation) {
recordDroppedFrames();
startRecordingDroppedFrames();
}
});
animationView.addAnimatorUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
seekBar.setProgress((int) (animation.getAnimatedFraction() * 100));
}
});
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!animationView.isAnimating()) {
animationView.setProgress(progress / 100f);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
return view;
}
use of android.animation.Animator in project LuaViewSDK by alibaba.
the class UDAnimatorSet method setupValues.
public UDAnimatorSet setupValues(Animator animator) {
animator.setupStartValues();
if (mTarget != null && mAnimators != null) {
for (Animator anim : mAnimators) {
anim.setTarget(mTarget.getView());
anim.setupStartValues();
if (anim instanceof ValueAnimator) {
((ValueAnimator) anim).setRepeatCount(mRepeatCount);
((ValueAnimator) anim).setRepeatMode(mRepeatMode);
//TODO
}
}
if (animator instanceof AnimatorSet) {
((AnimatorSet) animator).playTogether(mAnimators);
}
}
return this;
}
Aggregations