use of android.view.ViewPropertyAnimator in project UnityModManager by xausky.
the class FabBehavior method show.
// 显示时的动画
private void show(final View view) {
ViewPropertyAnimator animator = view.animate().translationY(0).setInterpolator(INTERPOLATOR).setDuration(200);
animator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
view.setVisibility(View.VISIBLE);
isAnimate = true;
}
@Override
public void onAnimationEnd(Animator animator) {
isAnimate = false;
}
@Override
public void onAnimationCancel(Animator animator) {
hide(view);
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
use of android.view.ViewPropertyAnimator in project aos-MediaLib by nova-video-player.
the class GlobalResumeView method launchOpenAnimation.
public void launchOpenAnimation(AnimatorListener listener) {
ViewPropertyAnimator a = animate();
a.scaleX(5f).scaleY(5f).alpha(0f);
a.setDuration(300);
a.setListener(listener);
}
use of android.view.ViewPropertyAnimator in project android-test by android.
the class ScaledViewActivity method setupView.
private void setupView() {
setContentView(R.layout.scaledview_activity);
View scaledView = findViewById(R.id.scaled_view);
scaledView.setOnClickListener(new View.OnClickListener() {
private boolean scaled = false;
@Override
public void onClick(View v) {
ViewPropertyAnimator animator = v.animate();
animator.cancel();
if (scaled) {
animator.scaleX(1f).scaleY(1f).start();
scaled = !scaled;
} else {
animator.scaleX(0.5f).scaleY(0.5f).start();
scaled = !scaled;
}
}
});
}
use of android.view.ViewPropertyAnimator in project mTHMMY by ThmmyNoLife.
the class ScrollAwareLinearBehavior method hide.
/**
* Animates the hiding of a bottom navigation bar.
*
* @param bottomNavBar bottom navigation bar View
*/
private void hide(final View bottomNavBar) {
ViewPropertyAnimator animator = bottomNavBar.animate().translationY(bottomNavBar.getHeight()).setInterpolator(new FastOutSlowInInterpolator()).setDuration(ANIMATION_DURATION);
animator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
bottomNavBar.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
use of android.view.ViewPropertyAnimator in project mTHMMY by ThmmyNoLife.
the class EditorView method hideMarkdown.
/**
* Animates the hiding of the markdown options.
*/
public void hideMarkdown() {
if (formatButtonsRecyclerview.getVisibility() == GONE)
return;
ViewPropertyAnimator animator = formatButtonsRecyclerview.animate().translationY(formatButtonsRecyclerview.getHeight()).setInterpolator(new FastOutSlowInInterpolator()).setDuration(ANIMATION_DURATION);
animator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
formatButtonsRecyclerview.setVisibility(View.GONE);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
Aggregations