use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Douya by DreaminginCodeZH.
the class FriendlyFloatingActionButton method hide.
public void hide() {
if (!mShowing) {
return;
}
mShowing = false;
cancelAnimator();
mAnimator = ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), getHideTranslationY()).setDuration(mAnimationDuration);
mAnimator.setInterpolator(new FastOutLinearInInterpolator());
mAnimator.start();
}
use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Douya by DreaminginCodeZH.
the class AppBarWrapperLayout method hide.
public void hide() {
if (!mShowing) {
return;
}
mShowing = false;
cancelAnimator();
mAnimator = new AnimatorSet().setDuration(mAnimationDuration);
mAnimator.setInterpolator(new FastOutLinearInInterpolator());
AnimatorSet.Builder builder = mAnimator.play(ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), getHideTranslationY()));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
builder.before(ObjectAnimator.ofFloat(mShadowCompatView, ALPHA, mShadowCompatView.getAlpha(), 0));
} else {
builder.before(ObjectAnimator.ofFloat(mAppbarView, TRANSLATION_Z, mAppbarView.getTranslationZ(), -mAppbarView.getElevation()));
}
startAnimator();
}
use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Carbon by ZieIony.
the class AnimUtils method getProgressWidthOutAnimator.
public static Animator getProgressWidthOutAnimator() {
ViewAnimator animator = new ViewAnimator();
animator.setInterpolator(new FastOutLinearInInterpolator());
animator.setOnSetupValuesListener(() -> {
ProgressView circularProgress = (ProgressView) animator.getTarget();
float start = circularProgress.getBarWidth();
animator.setFloatValues(start, 0);
animator.setDuration((long) (100 * start));
});
animator.addUpdateListener(valueAnimator -> {
ProgressView circularProgress = (ProgressView) animator.getTarget();
final float arcWidth = circularProgress.getBarPadding() + circularProgress.getBarWidth();
float value = (Float) valueAnimator.getAnimatedValue();
circularProgress.setBarWidth(value);
circularProgress.setBarPadding(arcWidth - value);
});
return animator;
}
use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Transitions-Everywhere by andkulikov.
the class ScaleSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scale, container, false);
final ViewGroup transitionsContainer = view.findViewById(R.id.transitions_container);
final TextView text1 = transitionsContainer.findViewById(R.id.text1);
transitionsContainer.findViewById(R.id.button1).setOnClickListener(new VisibleToggleClickListener() {
@Override
protected void changeVisibility(boolean visible) {
TransitionManager.beginDelayedTransition(transitionsContainer, new Scale());
text1.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
});
final TextView text2 = transitionsContainer.findViewById(R.id.text2);
transitionsContainer.findViewById(R.id.button2).setOnClickListener(new VisibleToggleClickListener() {
@Override
protected void changeVisibility(boolean visible) {
TransitionSet set = new TransitionSet().addTransition(new Scale(0.7f)).addTransition(new Fade()).setInterpolator(visible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
TransitionManager.beginDelayedTransition(transitionsContainer, set);
text2.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
});
return view;
}
Aggregations